Private Statement
- Updated2024-09-12
- 1 minute(s) read
VBScript Language Directory > Private Statement
Private Statement
You can use the Private statement to declare private variables and allocate storage space for these variables. You can use the Private statement on script level or on class level, but not in a function or a procedure.
If you use the Private statement on script level, the declared variables are available within the entire script. Declaring with Private has the same effect as declaring with Dim or Public.
If you use the Private statement in a Class block, the declared variables are only available within this class. The variables you declare within a class using Public are automatically available to the class as general properties.
Private 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