On 01.07.2019 15:57, Ryan Joseph wrote:
Yes, I’ve made a patch to allow overriding the actual property
(https://bugs.freepascal.org/view.php?id=35772).
Very good! Just a short question: does your solution allow one overload
without array indexes? It is very useful as a for-in enumerator of the
array property:
TTest = class
public
// ...
property StringArray[Index: Integer]: string read GetString;
property StringArray: TTestObjectEnumerator read GetString;
end;
procedure DoTest(a: TTest);
var
s: string;
begin
for s in a.StringArray do
Writeln(s);
end;
See full code:
https://bugs.freepascal.org/file_download.php?file_id=23296&type=bug
(File arraypropenum.lpr in https://bugs.freepascal.org/view.php?id=28820
Ondrej
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel