omron — String Data Type

String Data Type String Data Type Variable names are preceded with a dollar ($) sign to indicate that they contain string data. 1 The program instruction: $string_name = "Omron Adept eV+" allocates the string variable string_name (if it had not previously been allocated) and assigns it the value Omron Adept eV+. Numbers can be used as strings with a program instruction such as: $numeric_string = "13.5" where numeric _string is assigned the value 13.5. The program instruction: $numeric_string = 13.5 results in an error since you are attempting to assign a real value to a string variable. The following restrictions apply to string constants (e.g., "a string"):

l ASCII values 32 (space) to 126 (7e) are acceptable l ASCII 34 (") cannot be used in a string Strings can contain from 0 to 128 characters. String variables can contain values from 0 to 255. For the interpretation of the full character set, see the section Character Sets on page 223. The following are all valid names for string variables: $x $process $prototype.names $part_1 The following names are invalid for strings for the reasons indicated: $3x (first character not a letter) $one-two (- is an invalid name character) factor ($ prefix missing) $this_is_a_long_name (too many characters) All but the last of these invalid names are rejected by eV+ with an error message.

The extra long name is truncated (without warning) to $this_is_a_long_. ASCII Values An ASCII value is the numeric representation of a single ASCII character. (For a complete list of the ASCII character set, see the section Character Sets on page 223.) An ASCII value is specified by prefixing a character with an apostrophe ('). Any ASCII character from the space character (decimal value 32) to the tilde character (7e, decimal value 126) can be used as an ASCII constant. Thus, the following are valid ASCII constants: 'A '1 'v '% eV+Language User's Guide, v2.x, 18318-000 Rev A Page 40