Name
Low Function
Syntax
function Low(Type or variable):Ordinal type;
Description
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.
Tips and Tricks
In a
forloop, subrange type declaration, or any other situation where you use the limits of an ordinal or array type, always use theLowfunction 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 theLowfunction.Calling
Lowfor aShortStringreturns zero, which is the index of the length byte. You cannot callLowfor anAnsiStringorWideString, so use 1 because long strings always have an origin of 1.Lowfor an open array parameter is always zero, regardless of the type or range of the actual array argument.
Example
See the High function for an example.
See Also
| Dec Procedure, High Function, Inc Procedure, Length Function, Pred Function, Succ Function |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access