Get Array Length

 

At times it may be appropriate to assign more than one value to a single variable. In such instances, create a variable that contains a series of values. This series is called a variable array. If the variable is named "sales", then the array elements would be designated as sales[1], sales[2] and so on up to the number of elements defined in the array. Array elements start with [1] and not [0]. Each element stores a separate value.

 

Get Array Length returns the maximum number of elements defined for an array variable. This command is useful when used in conjunction with a Repeat command. Use it to change the number of array elements without modifying the macro script.

 

 

Script Editor > Expand Variables Category > Get Array Length

 

 

Array to retrieve length of:

Select the array variable from which to retrieve the number of elements.

 

 

Store result in:

The maximum length of the array is saved to the variable selected. The variable selected must be an Integer variable. The Integer variable stores the number of elements that were defined for the variable - in this case the variable named "sales".

 

 

See the Defining Variables topic for more information about arrays.