delphipascalscriptremobjects

How to register indexed property in RemObject?


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.


Solution

  • 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);