Variable types

The type of a variable refers to the type of data represented by the variable. STL uses three variable types:
  • Integer variables can take any positive integer value from 0 to 2147483647. When a network is first initialized, the value of an integer variable is 0. Integer variables translate into counters in the scripting language.
    Note: An integer variable's value will wrap if incremented beyond 2147483647 or decreased below 0. That is, if a variable has a value of 2147483647 and 1 is added to it, the result is 0. If a variable has a value of 2 and 3 is subtracted from it, the result is 2147483647.
  • String variables can contain only characters. They must be from 0 to 32767 characters long. A character can be any 1-byte value. (A 1-byte value is X'00' to X'FF'.) Double-byte character set data must be enclosed in SO and SI characters and must be coded on the same record. For more information on DBCS, see Simulating DBCS terminals. When a network is first initialized, the value of a string variable is '' (the null string, which is represented by a pair of single or double quotation marks). String variables translate into save areas in the scripting language.
  • Bit variables represent binary data items—that is, data items that can take one of two possible values. STL bit variables can have the value of ON or OFF. When a network is initialized, all bit variables have a value of OFF. Bit variables translate into switches in the scripting language.
You should initialize integer, string, and bit variables explicitly whenever possible since the save area, counter, or switch represented by the variable may have been altered before the execution of an STL program.