This Helper sounds like a nice way to do it.  I need the numerical index of
the loop so this would be more straight forward.
Would I then do something like :
For I:= 0 to MyStringList.High Do 
?

When I try to add the Type statement:
type TStringListHelper = class helper for TStringList function High:
NativeInt; end;
I get    Error: Identifier not found "class"

I have the Classes unit.  Is there something else I am missing?

James

>Another alternative would be declaring a helper:

>type TStringListHelper = class helper for TStringList function High:
NativeInt; end;

>function TStringListHelper.High: NativeInt; begin
>  Exit (Self.Count-1);
>end;

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to