Re: checking arbitrary bounds



"Pawel Slusarz" <wiedzmin@xxxxxxxxx> wrote in message
news:iQLle.11169$PS3.2823@xxxxxxxxxxxx
> Surely someone must've run into this before. I want to write a
> function that combines the functionality of Low() and High().
>
> // non-working example
> function IsIndexWithinBounds(i : integer; var a) : boolean;
> begin
> Result := (i >= low(a)) and (i <= high(a));
> end;
>
> I'd settle for arbitrary arrays, if the above can't be done.

Thanks for the responses. Thinking more about the problem, it
seems to me that the right direction for me would be to move
away from the arrays (and string lists) into a Collections
library.

Paul


.