Indexed property


(Friedrich Westermann) #1

Can’t find it anywhere in the Docs
is there an equivalent for Oxygene?

in Delphi i can do:

type
  tTable_PH_CNC = public class
protected
    method GetValueInteger(&Index: Integer): Integer;
    method SetValueInteger(&Index: Integer; const Value: Integer);
public

property FUNC :  Integer index 1 read getValueInteger write setValueInteger; // FUNC
property SIDE :  Integer index 2 read getValueInteger write setValueInteger; // SIDE
end;

(Carlo Kok) #2

we don’t have this, per se, but you can do something like:

type
  tTable_PH_CNC = public class
protected
    method GetValueInteger(&Index: Integer): Integer;
    method SetValueInteger(&Index: Integer; const Value: Integer);
   property Index[&Index: Integer]: Integer read GetValueInteger write SetValueInteger;
public

property FUNC :  Integer read Index[1]write Index[1]; // FUNC
property SIDE :  Integer read Index[2]write Index[2]; // SIDE
end;

(Friedrich Westermann) #3

Thanks, this will help