Static Definition

Syntax

Static name[type][([dim[, ...]])][As [New] type][, ...]

Group

Declaration

Description

A static variable retains it value between procedure calls. Dimension var array(s) using the dims to establish the minimum and maximum index value for each dimension. If the dims are omitted then a scalar (single value) variable is defined. A dynamic array is declared using ( ) without any dims. It must be ReDimensioned before it can be used.

See Also: Dim, Option Base, Private, Public, ReDim.

Example

Sub A
Static X
Debug
.Print X
X = "Hello"
End
Sub

Sub
Main
A
A ' prints "Hello"
End
Sub