NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

set number of elements in a two dimensional array

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

0 Kudos
Message 1 of 2
(4,185 Views)

From the help file (TestStand 4.2.0):

 

PropertyObject.SetNumElements

 

SetNumElements Method

Syntax

PropertyObject.SetNumElements ( numElements, options = 0)

Purpose

Sets the number of elements of a single dimensional array.

Remarks

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.

Parameters

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).

0 Kudos
Message 2 of 2
(4,181 Views)