Previous Topic: Object Reference Data TypeNext Topic: ValueMap Data Type


String Data Type

You can type strings as literal values in an expression. Functions and JavaScript operators in an expression also return strings. To distinguish between identifiers (such as variable names) and literal strings, enclose the literal strings in string delimiters. You can use either single quotation marks or double quotation marks as string delimiters. For example, to use a literal string for the name of a program to start a UNIX process, type it as follows:

"/usr/smart/program"

In text boxes marked with an asterisk (*), enter either an expression or a literal string between quotation marks. The asterisk indicates that CA Process Automation evaluates the contents of the text box as an expression. Do not use quotation marks to delimit expressions.

Text boxes that expect literal values are not labeled with an asterisk (*). In such cases, do not delimit strings with quotation marks.

JavaScript uses the backslash character (\) to escape literal strings. If a semantic action is attached to an escaped character, the character is converted to its character equivalent instead of performing the semantic action. For example, 'C:\\pam' is converted to 'C:\pam'.

CA Process Automation interprets any character that follows the escape character literally instead of parsing it through the language interpreter. For example, to include a double quotation mark in a string, precede it with the escape character, \”. In this case, the parser does not interpret the double quotation mark as the string delimiter. To include the backslash in a string, precede it with the escape character, \\.

To include the same character that you use as your delimiter in your string, escape the character when do not use it as a delimiter. For example, the following string is delimited with single quotation marks. The string includes single quotation marks as escaped characters and double quotation marks as literal characters:

'Database engine can\’t find database \'CHECKERS\' on server "GAMES"'

The same string, delimited with double quotation marks, includes the single quotation marks as literal characters and the double quotation marks as escaped characters:

"Database engine can't find database 'CHECKERS' on server \"GAMES\""

The following table shows JavaScript escape sequences:

Sequence

Character Represented

\0

The NUL character (\u0000)

\b

Backspace (\u0008)

\t

Horizontal tab (\u0009)

\n

Newline (\u000A)

\v

Vertical tab (\u000B)

\f

Form feed (\u000C)

\r

Carriage return (\u000D)

\"

Double quotation mark (\0022)

\'

Apostrophe or single quotation mark (\0u0027)

\\

The Latin-1 character specified by two hexadecimal digits NN