Table of Contents

TatClass.DefineNewProp Method

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

Remarks

Unlike DefineProp, DefineNewProp always creates a new TatProperty object. If a property named AName already exists, two objects for the same property 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 DefineProp for more information.

Syntax

Unit: atScript

function TatClass.DefineNewProp(AName: string; ADataType: TatTypeKind; AGetter: TMachineProc; ASetter: TMachineProc; APropertyClass: TClass = nil; AIsClassProp: Boolean = False; AIndexCount: Integer = 0): TatProperty;

Parameters

<-> Parameter Type Description
AName string
ADataType TatTypeKind
AGetter TMachineProc
ASetter TMachineProc
APropertyClass TClass Optional: Default value is nil

AIsClassProp Boolean Optional: Default value is False

AIndexCount Integer Optional: Default value is 0

See also