Static Definition

Syntax

Static vardeclaration[, ...]

Group

Declaration

Description

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

Related Topics


Sub A
    Static X
    Debug.Print X
    X = "Hello"
End Sub
 
Sub Main
    A
    A ' prints "Hello"
End Sub