Dim statement
Declare variables and allocate buckets.
DimVarname [([subscripts])] [, varname [([subscripts])]...
Parameters
Varname
Variable name, which complies with the naming conventions of standard variables.
Subscripts
The dimension of the array variable. up to 60-dimensional arrays can be declared.SubscriptsThe parameters use the following syntax:
Upperbound [, upperbound]...
The lower bound of the array is always 0.
Description
UseDimDeclared script-level variables can be used in all processes in the script, and process-level variables can only be used in the process.
It can also contain parentheses.DimStatement to declare a dynamic array. After declaring a dynamic array, you can useRedimStatement to define the dimension and element of the array. If you try to redefineDimAn error occurs when the dimension array has been explicitly specified in the statement.
Note:UseDimStatementDimStatement at the beginning of the process.
The following example illustrates how to useDimStatement:
DimNames (9 )'
Declare10
Array of elements.DimNames ()'
Declare a dynamic array.DimMyvar, mynum'
Declare two variables.