| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
| String constant | Explanation |
|---|---|
| "Signature Systems, Inc." | alphabetic characters |
| "4325 Harrison Grade Road" | alphanumeric characters |
| "(707) 874-1250" | alphanumeric and special characters |
| "@FF@" | hex constant FF |
| "@2020@" | hex constant 2020 |
String variables are named memory locations used to store string data (up to 254 characters per variable). In MTB, string variable names may be any number of characters long, although the compiler recognizes only the first 30 characters of the name. String variable names may be upper or lower case, may include imbedded decimal points, and must end with a dollar sign ($) character. They may not include imbedded blanks or other special characters. For example, the following are valid string variable names:
CUSTOMER$ customer$
PARTNUMBER$ Part.number$ part.number$
A$ a$
VALUE1$ value1$
CITYSTATEZIPCODE$ City.State.ZIP$
In MTB, all variables must be defined before they can be used.
These definitions include the variable name, type (string or
numeric), length, and classification. For more information, see
the documentation.
Numeric data
Numeric data may also be classified as constant or variable.
Numeric constants are fixed numeric values included in a program;
they may contain digits, a decimal point, and a trailing minus
sign. Commas are not allowed in numeric constants. Numeric
constants may contain up to 16 digits, 15 of which may be located
to the right side of the decimal point. For example, the
following values are numeric constants:
100
1234.56
2500.9999-
1.234567890123456
1234567890123456.
Numeric variables are named memory locations used to store
numeric data (up to 16 digits per variable). In MTB, numeric
variable names may be any number of characters long, although the
compiler recognizes only the first 30 characters of the name.
Numeric variable names may be upper or lower case and may include
imbedded decimal points. They may not include imbedded blanks or
other special characters. For example, the following are valid
numeric variable names:
CREDITLIMIT Credit.limit
AROVER120 AR.over.120
INVENTORYVALUE inventory.value
X x
AMOUNT amount
In MTB, all variables must be defined before they can be used.
These definitions include the variable name, type (string or
numeric), length, and classification. For more information, see
the Data Division documentation.