Declarations and Initialization
The variables that you define in the declarations section are used to store values. Variables consist of a name and a data type. Variable names can include alphanumeric characters and the colon (:) and underscore (_). The first character in a variables name may not be a numeric. All variable names are case-sensitive.
Notes:
- A declaration must be terminated with a semicolon (;). To improve readability, you typically include a blank link in between the declaration and statement sections.
- In maps, the Translator does not initialize extended rule variables. You must initialize all variables after declaring them. Variables that are not initialized can cause incorrect results or translation failures. For forms, initialization is not necessary.
| Data Type | Description | Example |
|---|---|---|
| Integer | a whole number with no decimal component | Declare i as an integer and initialize. |
| Real | a whole number that may have a decimal component | Declare r as a real number and initialize. |
| String | contains one or more printable characters | Declare s as a 20-character string and
initialize. |
| Datetime | contains a date or time | Declare d as a date or time and initialize. |
| Array | defines a table of multiple occurrences of a single data type | Declare a as an array of 10 integers and
initialize.Declare p as an array of 50 10-character strings and initialize. |
| Object (for maps only) |
used for user exits; exposes the internal functions of an ActiveX Automation Server to Sterling Gentran:Server® | Declare ob as an object and initialize. |