Low Function
The Low
function returns the smallest value of an
enumerated type, the lower bound of an array index, or the same
information for a variable of ordinal or array
type.
Low
is built into the compiler and is not a real
function.
In a for
loop, subrange type declaration, or any
other situation where you use the limits of an ordinal or array type,
always use the Low
function instead of referring
explicitly to the low ordinal value. A future version of your code
might change the type, and you don’t want to scramble through
all your code looking for explicit references to an enumerated
literal that should really have been calls to the
Low
function.
Calling Low
for a ShortString
returns zero, which is the index of the length byte. You cannot call
Low
for an AnsiString
or
WideString
, so use 1 because long strings always
have an origin of 1.
Low
for an open array parameter is always zero,
regardless of the type or range of the actual array argument.