I'm surprised you didn't mention LBOUND and UBOUND.
a (no login) Posted May 22, 2012 2:17 PM
The loops can be coded to use the LBOUND and UBOUND functions in the event that the array start/finish items change:
FOR ITEM = LBOUND(myarray) TO UBOUND(myarray)
Of course, one can just as easily DIM the array using min/max variables:
DIM SHARED MIN
DIM SHARED MAX
MIN = 1
MAX = 10
DIM myarray (MIN TO MAX)
This eliminates the need to call the UBOUND function repeatedly to determine if the loop should terminate, assuming that is what QB does. I know some other languages call the function each time rather than evaluating the function call when the loop starts because you might do something to affect the end result such as re-sizing an array.
I unfortunately have no copy of QB at the moment to test, but the MIN/MAX concept can be applied universally. Since they are declared using DIM SHARED, their values can be altered as needed in any SUB or FUNCTION procedure, such as removing an available seat if it is in bad repair.