In a string literal, you can specify special control characters and characters that might not be available on your keyboard, such as new lines (line feeds) and carriage returns. If you specify such characters in a string, you must use an escape sequence. This consists of the ESL escape character - a backslash (\) - followed by a code representing the special character. The escape character itself is not part of the string; it tells ESL that you want to "escape" from the string to specify a character that cannot be specified explicitly in the string.
The following are escape sequences supported by ESL:
Escape Sequences
Escape Sequence |
Meaning |
\" |
Quotation mark |
\\ |
Backslash |
\a |
Right align in action bars |
\b |
Backspace (destructive) |
\^H |
Backspace (destructive) |
\e |
Escape |
\f |
Form feed (new page) |
\n |
Line feed (new-line) |
\^J |
Line feed (new-line) |
\r |
Carriage return |
\t |
Tab (horizontal) |
\v |
Tab (vertical) |
\^D |
Control-D |
When you send data to an application program, you often must end the data with the new-line escape sequence. This sequence simulates the Return key on the keyboard. Most applications do not recognize input until they receive the new-line character. To specify a new-line character in a string literal, you specify the ESL escape character followed by a lowercase n or a ^J, which represents a new-line character:
"OK\n"
or
"OK\^J"
The length of either of these strings is three characters; "OK" followed by a new-line character.
You cannot specify a quotation mark directly within a string literal because ESL recognizes the second quotation mark as the end of the literal. However, by specifying an escape character before the quotation mark, you tell ESL to escape from the string and process the character. For example, to display the following string on the screen:
Type "OK" when you are ready
you specify the following:
"Type \"OK\" when you are ready"