QBasic 1.1: COMMON Statement
Explanation
COMMON Statement
Defines global variables that can be shared throughout a program or between chained programs.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
COMMON [SHARED] variablelist |
Description / Parameter(s)
SHARED |
Indicates that variables are shared with all SUB or FUNCTION procedures. |
variablelist |
One or more variables to be shared: |
|
variable[( )] [AS type] [, variable[( )] [AS type]]... |
variable |
A Basic variable name. Variable names can consist of up to 40 characters and must begin with a letter. Valid characters are A-Z, 0-9, and period (.). |
type |
The data type of the variable (INTEGER, LONG, SINGLE, DOUBLE, STRING, or a user-defined data type). |
|
Unless it has been declared as a static array in a preceding DIM statement, an array variable in a COMMON statement is a dynamic array. Its dimensions must be set in a later DIM or REDIM statement. |