Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

ReDim

  • Last UpdatedJul 18, 2023
  • 1 minute read

Used to size or resize a dynamic array that has already been declared using the Dim statement with empty parentheses.

Use the ReDim statement to change the number of elements in an array, but not to change the number of dimensions in an array or the type of the elements in the array.

Syntax

ReDim VariableName(Subscripts)

VariableName:

The name of the variable or array being redimensioned.

Subscripts:

An Integer or expression representing a valid To numeric value range when declaring the dimensions of an variable array. Up to 60 multiple dimensions may be declared.

The subscripts argument uses the following syntax:

[lower To] upper [,[lower To] upper] . . .

When not explicitly stated in lower, the lower bound of an array is controlled by the Option Base statement. The lower bound is zero if no Option Base statement is present in the VBA file.

Dim | Const | Static

Example

Dim TestArray() As Integer

Dim I

ReDim TestArray(10)

For I = 1 To 10

TestArray(I) = I + 10

Print TestArray(I)

Next I

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in