Array.ToVariantArray

Syntax

ToVariantArray: Array;

Description

The ToVariantArray method creates a new array by converting the source array into the array with the Variant type.

Example

Sub UserProc;
Var
    arrD: Array[3Of Double = [1.02.03.0];
    arrS: Array[22Of String = [["AA""AB"], ["BA""BB"]];
    arrV1, arrV2: Array Of Variant;
Begin
    arrV1 := arrD.ToVariantArray;
    arrV2 := arrS.ToVariantArray;
    Debug.WriteLine(arrV1.Length);
    Debug.WriteLine(arrV2.Length);
End Sub UserProc;

After executing the example, two arrays with the Double and String types are converted to the array with the Variant type. Sizes of output arrays will be displayed in the development environment console.

See also:

Array