| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
| Overview | Variable Names | Variable Types | Variable Length | Variable Classification | Data Division Statements | System Variables |
| Syntax: | LOCAL variable-list | ||||||
| Discussion: |
The LOCAL statement defines all data variables that will be used
exclusively by the current MTB program (i.e., they will not be
shared with or "overlayed" to other MTB programs.)
All variables (other than Comet
The variable-list includes MTB variable names, each separated by
a comma or blank space. Any number of variables can be declared
with one LOCAL statement.
The LOCAL statement generally follows a related LENGTH
statement. String variables defined in the variable-list must be
preceded by a LENGTH statement defining the length of the fields.
Numeric variables do not necessarily require a LENGTH statement;
those with no preceding numeric 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: LOCAL statements may be mixed with COMMON statements
without affecting the mapping of COMMON variables.
For example, LENGTH 25 defines the length of NAME$, ADDRESS1$,
and ADDRESS2$ (i.e., they will each store a maximum of 25
characters). The LENGTH 9.2 statement defines the length and
precision of the numeric variable CRLIMIT (i.e., it will store up
to nine digits, two of which will be to the right of the decimal
point).
|