checking arbitrary bounds



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 your comments,
Paul


.



Relevant Pages

  • Re: checking arbitrary bounds
    ... > I'd settle for arbitrary arrays, if the above can't be done. ... away from the arrays (and string lists) into a Collections ... Paul ... Prev by Date: ...
    (comp.lang.pascal.delphi.misc)
  • WTB: Galaga Mini
    ... non-working. ... Missing boards OK. ... No major projects, ... Prev by Date: ...
    (rec.games.video.arcade.collecting)
  • WTB near Colorado: Joust
    ... Looking for an upright Joust in or near Colorado. ... non-working are both okay. ... Prev by Date: ...
    (rec.games.video.arcade.collecting)
  • WTB near Colorado: Joust
    ... Looking for an upright Joust in or near Colorado. ... non-working are both okay. ... Prev by Date: ...
    (rec.games.video.arcade)
  • WTB near Colorado: Joust
    ... Looking for an upright Joust in or near Colorado. ... non-working are both okay. ... Prev by Date: ...
    (rec.games.video.arcade.marketplace)