A script literal consists of a freely selectable string that is put in single (') or double (") quotation marks.
A script literal can also contain script variables which are replaced by their values when the script line containing the script literal is processed.
:SET &TIME# = SYS_TIME("HH:MM:SS")
:PRINT "Time &TIME#"
The AE name is a particularity of the script literal. It does not have to be enclosed in single or double quotation marks. AE names are:
:SET &STATUS# = SYS_HOST_ALIVE(WIN01)
Quotation marks are always required when the AE name starts with a number.
Note that using the string <![[ ]]> in script literals results in a Syntax error and the object cannot be stored. There are several solution strategies to avoid this error:
- Insert a comment which includes these characters.
:PRINT '<![[ ]]>'
- This error only occurs if the described characters are used one after the other. Hence, you can also compose a string of 2 different script literals.
Example: Use script variables
:SET &VAR# = "]]"
Example: Use the script element STR_CAT
:SET &VAR# = STR_CAT("<![[ ]]",">")
Another peculiarity is the reserved combination ##<number>. If you use this string in a script literal, the text is included in the message whose number is specified in <number>. Keep this in mind when you use script literals.
shows the following result in the result:
2011-06-15 13:01:51 - U0020408 ENDED_NOT_OK - aborted.|