Table of Contents

TatCustomScripter.DefineMethod Method

Registers a global method in the scripter, accessible from all scripts without an object prefix.

Remarks

Use DefineMethod to define a "global" method. DefineMethod can be called from an existing TatClass object to register a new method in that class. When you call DefineMethod directly from scripter component, the method is not included in a class, but globally in scripter. Thus the method will behave as a regular procedure/function, being accessible from scripts without needing to define an object from which the method will be called. For more details about usage of DefineMethod, see TatClasses.DefineMethod.

Syntax

Unit: atScript

function TatCustomScripter.DefineMethod(AName: string; AArgCount: Integer; AResultDataType: TatTypeKind; AResultClass: TClass; AProc: TMachineProc; AIsClassMethod: Boolean = False; ADefArgCount: Integer = 0; AParameterHints: string): TatMethod;

Parameters

<-> Parameter Type Description
AName string
AArgCount Integer
AResultDataType TatTypeKind
AResultClass TClass
AProc TMachineProc
AIsClassMethod Boolean Optional: Default value is False

ADefArgCount Integer Optional: Default value is 0

AParameterHints string

See also