Script Character Strings |
Textual data is enclosed in double quotes and can be a string up to 140 characters long. You may continue a string on a new line by typing a backslash, \, at the end of the line. To use the value of a string variable, type the variable along with the text. Place double quotes around the entire string. For example: _s = "how to use" ECHO "This is _s a variable in a string." displays: This is how to use a variable in a string. Variables within strings are replaced by their values, converting integers to text. The # operator, along with a variable, is replaced by the number of answers in the answer set and is converted to text. If you want a variable within a string to be immediately followed by non-blank text, separate the variable name and text with a period. For example: _variable = "con" ECHO "This example string includes _variable.catenated text" displays: This example string includes concatenated text Special characters and escape characters within strings are:
Note that many networks and STN Express use control characters in normal operations. As a result, indiscriminate use of control characters may result in lost data, locked sessions, or terminated processes. The characters _, \, ", [, and # have special use within the script language and must be doubled if they are to be used within a string. In other words, to include a [ in a string, use two in a row: ECHO "Here is a string with a left bracket (i.e., [[) in it." displays: Here is a string with a left bracket (i.e., [) in it. A distinction between upper- and lowercase is made when the characters are within a string, and the number of spaces between words and letters is not ignored. |
Copyright
© 2017 American Chemical Society. All Rights Reserved.