An array is generally called an ordered set of elements, each of which has a certain (same) type. Arrays are static and dynamic. The length of the first is set at the programming stage, i.e. before starting the program to run, the second - in the course of execution.
For a static array, the description must determine the number of elements that cannot be changed (increase or decrease) during the program operation. When you start a program that uses a static array, a certain number of bytes is allocated in memory for execution to store its elements. This amount of memory will be assigned to the program until it finishes its work. Even if this memory will not be used, no other program code will be able to access it.
The Pascal programming language can only work with static arrays. Therefore, if you want to work with a sequence of variable length, you can describe the structure, for example, of one hundred elements, and use at different stages a different number of elements, not exceeding the number 100. And this, of course, is unreasonable.
Such a problem does not exist in the Delphi IDE . A dynamic array allows not describing the number of elements in the description, but determining it during program execution. A dynamic array can be described in the Var section as follows:
Var Massive: array of integer
, , Massive, (!) . , SetLength, , SetLength(Massive,9). Massive , 9. , , . . Delphi , , . Finalize, : Finalize(Massive).
Delphi. , :
Var Massive:array of array of integer
. SetLength.
, , / . « ». – . . -, . -, , . . , , .