Public Statement
- Updated2024-09-12
- 1 minute(s) read
VBScript Language Directory > Public Statement
Public Statement
You can use the Public statement to declare general variables and allocate storage space for these variables. You can use the Public statement on script level or on class level, but not in a function or a procedure.
If you use the Public statement on script level, the declared variables are available within the entire script. Declaring with Public has the same effect as declaring with Dim or Private.
If you use the Public statement in a Class block, the declared variables are automatically available to the class as general properties. The variables you declare within a class using Private are only available within this class.
Public VarName [([Dimension])][, VarName[([Dimension])] ...
| VarName | Name of the variable according to the standard conventions. |
| Dimension | Dimension of an array variable. Arrays can contain up to 60 dimensions. Separate the array sizes between the parentheses with commas to declare several dimensions: (Dimension1, Dimension2) |
Related Topics
Array | Dim | Private | Public | ReDim | IsArray | Erase | LBound | UBound