Table of Contents

TatClass.DefineNewMethod Method

Registers a new method in the class, always creating a new TatMethod regardless of whether one with the same name already exists.

Remarks

Unlike DefineMethod, DefineNewMethod always creates a new TatMethod object. If a method named AName already exists, two objects for the same method will coexist in the class. The scripter always uses the last one added, so behavior is correct. The advantage is that you can destroy your newly created object and the previous one is still in effect. The disadvantage is excess memory use if called many times with the same name. See DefineMethod for more information.

Syntax

Unit: atScript

function TatClass.DefineNewMethod(AName: string; AArgCount: Integer; AResultDataType: TatTypeKind; AResultClass: TClass; AProc: TMachineProc; AIsClassMethod: Boolean = False; ADefArgCount: Integer = 0): 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

See also