Name

VarArrayOf Function

Syntax

function VarArrayOf(const Values: array of Variant): Variant;

Description

VarArrayOf creates a one-dimensional Variant array that contains the same values as the open array argument. The resulting array has a lower bound of zero and an upper bound of the array size minus 1.

VarArrayOf is a real function.

Example

// The following two examples do the same thing.
V := VarArrayOf([1.0, 20, 'Testing']);

V := VarArrayCreate([0, 2], varVariant);
V[0] := 1.0;
V[1] := 20;
V[2] := 'Testing';

See Also

TVarArray Type, TVarArrayBound Type, VarArrayCreate Function, VarArrayDimCount Function, VarArrayHighBound Function, VarArrayLock Function, VarArrayLowBound Function, VarArrayRedim Procedure, VarArrayRef Function, VarArrayUnlock Function, Variant Type, VarIsArray Function, VarType Function

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.