CitectVBA Programming Reference > CitectVBA Function Reference > Declarations > Static


The Static statement allocates storage for-and declares the data type of-variables and arrays that will retain their values between subsequent references. Static variables are more commonly used within procedures (subroutines and functions), and have local scope.


Static VariableName[(Subscripts)] [As DataType]


The required name of the variable being declared (dimensioned).


The optional subscript range for an array.


The optional CitectVBA data type declaration for the variable.

Related Functions

Const | Dim | ReDim


Static bytVar As Byte
Static binVar As Boolean
Static strVar As String
Static intVar As Integer
Static lngVar As Long
Static sngVar As Single
Static dblVar As Double
Static vntVar As Variant
Static objVar As Object
Static dtmVar As Date
Static udtVar As <UserDefinedTypeName>