06-18-2010 08:50 AM
Hi,
Does anyone know how to set the number of elements in a two dimensional array directly in teststand.
To set a one dimsional array is simple:
SetNumElements( locals.somearray,4)
Is there a method to do this for a two dimensional array?
Sean
06-18-2010 09:39 AM - edited 06-18-2010 09:47 AM
From the help file (TestStand 4.2.0):
PropertyObject.SetNumElements
PropertyObject.SetNumElements ( numElements, options = 0)
Sets the number of elements of a single dimensional array.
This method is only valid for single dimensional arrays. The elements in the array retain their values. Use the PropertyObjectType.ArrayDimensions property to set the number of elements in each dimension of a multi-dimensional array.
numElements As Long
[In] New number of elements for the array.
options As Long
[In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options.
This parameter has a default value of 0.
So you could use, for example: Locals.MultidimensionalArray.Type.ArrayDimensions.SetBounds({1,0},{3,4}) to set an array to have three dimensions (1,2,3), each with five elements (0,1,2,3,4).