<< Prev        Next >>

ID : 5521

CreateMultiArray

Function

Create Variant type arrays with arbitrary Internal processing format. Up to three-dimensional arrays can be created.

This command is available in Ver.1.6.* or higher.

Syntax

CreateMultiArray(Internal processing format,Elements count of one-dimensional array 
[,Elements count of two-dimensional array [,Elements count of three-dimensional array ]])

Guaranteed entry

Internal processing format
Specify the Internal processing format of arrays that you intend to create by Integer type data. For about values of the Internal processing format, see Variant.h.
Elements count of one-dimensional array
Specify the number of elements in the first dimension of the array by Integer type data.
Elements count of two-dimensional array
Specify the number of elements in the second dimension of the array by Integer type data. This is an optional value. This will be the one-dimensional array if it is omitted.
Elements count of three-dimensional array
Specify the number of elements in the third dimension of the array by Integer type data. This is an optional value. This will be the two-dimensional array if it is omitted.

Return value

Return the Variant type array created.

Description

Create Variant type arrays with arbitrary Internal processing format. Up to three-dimensional array can be created.

If the elements count of the one-dimensional array assumes “N”, the index number of the array ranges from 0 through “N-1”. This rule applies to the elements counts of two- or three-dimensional arrays as well.

If you use constants, which are defined by Variant.h, for the internal processing format, embed Variant.h into #include.

Attention

Some Internal processing format which is defined by Variant.h, are not available for CreateMultiArray. If these are used, an error will occur at CreateMultiArray execution.

Example

'!TITLE "Create two- or more dimensional arrays"
'Create two-dimensional arrays and then assign values 

#include <Variant.h>

Sub Main
	Dim var As Variant

	var = CreateMultiArray(VT_R4, 2, 3) 
	var(0, 0) = POSX( P[0] )
	var(0, 1) = POSY( P[0] )
	var(0, 2) = POSZ( P[0] )
	var(1, 0) = POSRX( P[0] )
	var(1, 1) = POSRY( P[0] )
	var(1, 2) = POSRZ( P[0] )

End Sub

ID : 5521

<< Prev        Next >>