Programming C# C++ (7) Delphi (617) .NET (2) Database (71) Delphi IDE (89) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280) Java (8) JavaScript (31) perl (9) php (4) VBScript (1) Visual Basic (1)
Exchange Links About this site Links to us 
|
Safe Array Looping
This article has not been rated yet. After reading, feel free to leave comments and rate it.
An Object Pascal array is a group elements of a similar type with an index range.
How do you access every array element without looking back in your
code for the correct lower and upper index values?
The Low and High functions
ensure you access each element, as illustrated in this example code:
 | |  | | var
MyArray : array[2..11] of integer;
Position : integer;
begin
for Position := Low(MyArray) to High(MyArray) do
MyArray[Position] := 0;
end; | |  | |  |
Comments:
|
anonymous from China
|
|
|
|
this code is very easy
|
|