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

AVEVA™ Plant SCADA

Variable Array Declaration

  • Last UpdatedJul 18, 2023
  • 1 minute read

Arrays of variables are declared within a VBA file module, function, or subroutine, using the dim statement with parentheses positioned after the array name, in the following syntax:

Dim <ArrayName>( [<Subscripts>] ) [As <DataType>]

Where:

  • dim is the required variable declaration statement BASIC keyword.

  • <ArrayName> represents the required name of the array being declared (dimensioned).

  • ( )are the required parentheses to hold the array subscript range (dimensions).

  • <Subscripts> represents the optional subscript ranges and dimensions for the array.

  • As is the optional As statement keyword declaring the array data type.

  • <DataType> represents the optional VBA data type declaration for the array.

In the variable array declaration statement:

  • Every placeholder shown inside arrow brackets ( <placeholder> ) should be replaced in any actual code with the value of the item that it describes. The arrow brackets and the word they contain should not be included in the statement, and are shown here only for your information.

  • Statements shown between square brackets ( [ ]) are optional. The square brackets should not be included in the statement, and are shown here only for your information.

See Also

Fixed Size Arrays

Multi-Dimensional Arrays

Dynamic Size Arrays

Array Subscripts

Arrays of Variables

Dim

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