Previous Topic

Next Topic

Public statement

Declares global variables and allocates storage space.

Syntax

Public varname{[subscripts]} {As type} {, ... }

See Dim for details of syntax.

Comments

Public creates the variables in a company-wide global variable store that is cleared when the Company is closed. These variables are available in MaxBasic code. Public variables can be declared multiple times as long as the declaration has the same type.

To clear a Public variable set it equal to Null or Nothing.

To clear a Public array use the Erase statement. Public arrays can be resized using ReDim.

See Also

MaxBasic Statements

Book Contents

Book Index