How to register indexed property in RemObject?

114 Views Asked by At

I want to register property Strings of TStrings class. When I register a simple property, I write:

ACompiler.FindClass(ClassName).RegisterProperty(PropertyName,PropertyTypeName, PSPropType);

in OnCompImport Event

and

ARuntimeImporter.FindClass(ClassName).RegisterPropertyHelper(GetterCodeAddress, SetterCodeAddress, PropertyName);

in OnExecImport Event. But I have not found any RegisterIndexedProperty and RegisterIndexedPropertyHelper methods.

1

There are 1 best solutions below

0
Alexey Ignatenko On BEST ANSWER

Need write: property type, index type 1, index type 2, etc in property type parametrs. For Example:

    ACompiler.FindClass('TStringList').RegisterProperty('Strings',' String Integer',iptRW);

And in implementation method Value of a property type must be at the first place. For Example:

procedure GetStringsMethod(Self: TObject; var AValue: string; AIndex: Integer);

procedure SetStringsMethod(Self: TObject; const AValue: string; AIndex: Integer);