Create a variant array.
Source position: variants.pp line 130
function VarArrayCreate( |
const Bounds: array of SizeInt; |
aVarType: TVarType |
):Variant; |
const Bounds: PVarArrayBoundArray; |
Dims: SizeInt; |
aVarType: TVarType |
):Variant; |
Bounds |
|
Bounds for the array. |
aVarType |
|
Element type. |
The new variant array.
Bounds |
|
Bounds for the array. |
Dims |
|
Number of dimensions in array. |
aVarType |
|
Element type. |
VarArrayCreate creates a (optionally multidimensional) array with upper,lower bounds specified in Bounds. The number of bounds (in case of a single array) must be even: 2 bounds for every dimension of the array are required. All elements of the array are of the same type. The following examples create a one-dimensional array with 10 elements
VarArrayCreate([0,9],varInteger); VarArrayCreate([1,10],varInteger);
The first array is 0-based, the second is 1-based. The following creates a 2-dimensional array:
VarArrayCreate([0,9,0,1],varInteger); VarArrayCreate([1,10,1,2],varInteger);
The first array is 0-based, the second is 1-based. Each array consists of an array of 2 elements.
The array can also be specified as a pointer to array of system.tvararraybound records, and a number of dimensions. The above 1-dimensional arrays can be specified as:
var B : tvararraybound; begin b.elementcount:=10; B.lowbound:=0; VarArrayCreate(@B,1,varInteger); b.elementcount:=10; B.lowbound:=1; VarArrayCreate(@B,1,varInteger);
If an uneven amount of bounds is specified or the operating system failed to create the array, an exception is raised using VarArrayCreateError
|
Raise an EVariantArrayCreateError error. |
|
|
Create a variants array of a series of values. |