November 2019
Beginner to intermediate
674 pages
15h
English
Delphi supports two kinds of arrays. One is of a fixed size and has settable lower and upper bounds. We call them static arrays. Others have a lower bound fixed at zero, while the upper bound is variable. In other words, they can grow and shrink. Because of that, they are called dynamic arrays.
The following code fragment shows how static and dynamic arrays are declared in Delphi:
var sarr1: array [2..22] of integer; // static array sarr2: array [byte] of string; // static array darr1: array of TDateTime; // dynamic array darr2: TArray<string>; // dynamic array
Every array stores elements of some type. The compiler will treat these elements just the same as variables of that type. In the second declaration above, for example, the element ...
Read now
Unlock full access