Introduction | Language Structure | IB Statements | File System | Comet 32 Runtime | Index |
| Syntax: | COMMON variable-list | ||||
| Discussion: |
The COMMON statement defines data variables to be used by more
than one Internet Basic program. Common variables can be "overlayed" into
the same partition as the current program, or passed to a program
in another partition (e.g., a background partition).
All variables (other than Comet system variables) used in the I/O Format Division or Procedure Division of a program must be declared as COMMON or LOCAL. The variable-list includes Internet Basic variable names, each separated by a comma or blank space. Any number of variables can be declared with one COMMON statement. The COMMON statement generally follows a related LENGTH statement. String variables defined in the variable-list must be preceded by a LENGTH statement which defines the length of the fields. Numeric variables do not necessarily require a LENGTH statement; those with no preceding LENGTH statement are assigned a default length and precision of 8.2. Array definitions must include the number of elements (or the maximum number of indices for multi-dimensional arrays) as an integer constant or symbolic constant enclosed in parentheses. For example, ALPH$(26) defines a string array named ALPH$ with 26 elements, and VALUE(3,24) defines a numeric array named VALUE with 3 columns and 24 rows. See Arrays for more information. Note: You must define common variables in the same order and with the same length in each program that shares the variables. Variable names can be different from program to program, although it is good practice to keep them consistent. | ||||
| Application notes: |
|