<div dir="ltr">Another option :) from bugtracker by Kazantsev Alexey ( <a href="http://bugs.freepascal.org/view.php?id=28820#c89471">http://bugs.freepascal.org/view.php?id=28820#c89471</a> ) :<br><br>All you need is [s]love[/s] overloaded default properties. As in Delphi.<br><br>type<br><br> TObj = Class<br><br> Type<br><br> TValue = Type String;<br><br> TValues = Record<br><br> Function GetEnumerator : TEnumerator;<br><br> Property Items[AIndex : Integer] : TValue Read GetValueByIndex Write SetValueByIndex; Default;<br> Property Items[Const AName : String] : TValue Read GetValueByName Write SetValueByName; Default;<br><br> End;<br><br> Property Values : TValues Read GetValues;<br><br> End;<br><br>var v : TObj.TValue;<br> obj : TObj;<br><br>begin<br><br> obj.Values[1] := '1';<br> obj.Values['2'] := '2';<br><br> for v in Obj.Values do;<br><br>end. <br><div class="gmail_extra">-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>