Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function Low(X)
Returns the smallest available value for a range.
Low containing the first element of an Ordinal, Array or string. The Low function is used with the High function to determine the size of an array, for example.
//example 1
type TExperience=(Beginner, Intermediate, Advanced);
var aProg : TExperience;
aProg := High(aProg); //aProg = Advanced
//example 2
var
dblArray: array[1973..2003] of Double;
i : integer;
for i:= Low(dblArray) to High(dblArray) do
begin
// add code for i going from 1973 to 2003
end
//example 3
type TAPI=(API, MAPI, SAPI, IAPI);
var aapi:Tapi;
...
for i := Low(aapi) to High(aapi) do
if i:=mapi then showmessage(inttostr(i));
end;
|
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|