Public Statement
Define public variables and allocate buckets. InClassBlock to define private variables.
PublicVarname [([subscripts])] [, varname [([subscripts])]...
Parameters
Varname
The variable name follows 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:
Upper [,Upper]...
The lower bound of the array is always 0.
Description
Public Statement variables can be used in all processes in all scripts.
You must useSetStatement to assign an existing object to the variable. Before assigning values, the declared object variable is initialized to empty.
It can also contain parentheses.PublicStatement 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 re-declare the dimension of the array variable, and the size of the array variable is already in the private,PublicOrDimWhen explicitly specified in the statement, an error occurs.
The following example illustrates how to usePublicStatement:
PublicMynumber 'public variant variable.PublicMyarray (9) 'Public array variable. 'multiple public declarations of variant variables.PublicMynumber, myvar, yournumber