2.1 Language Structure
T-Plan Robot Enterprise language is a text-based programming language and scripts are typically saved as plain text files. The following general rules apply:
- ISO8859-1 (Latin-1) characters are recommended. Characters out of this set may be used in command arguments and parameter values but their support is subject to the particular remote desktop client and its protocol capabilities. Please read the client documentation before using other than ISO8859-1 characters.
- The language is NOT case sensitive unless where explicitly stated in this documentation.
Scripts are interpreted according to the following rules:
- Scripts are processed line by line. A single command or expression cannot be split to multiple lines unless the specification explicitly says so.
- Lines may contain any number of leading and/or trailing white space characters, i.e. spaces, tabulators etc. They will be trimmed before further processing.
- Empty lines are ignored.
- Lines beginning with hash '#' are considered to be comments and they are ignored. Version 2.3 and newer also accepts Java/C++ style comments starting with double slash '//':
# This is a comment
// This is also a comment
- Other text lines which are not eliminated by the rules above may contain one element of the scripting language, such as a command, procedure header, procedure call, an if/else/for statement or its terminating right curly brace ('}'). Each such a text line is processed in the following way:
- The text is broken into tokens by one or more spaces. Any text preceded by a space and enclosed between a pair of double quotes ("...") is considered to be a single token. An escaped double quote (\") is not considered to indicate the beginning or end of a token and for further processing is replaced with a double quote. Strings which have a form of 'identifier=value' or 'identifier="value with spaces"' are considered to be one single token and they are further parsed into identifier/value pairs.
This is a text containing spaces
- Will be parsed into 6 tokens: 'This', 'is', 'a', 'text', 'containing', 'spaces'.
This "is a text" containing spaces
- Will be parsed into 4 tokens, 'This', 'is a text', 'containing', 'spaces'.
This text contains "double quote (\")"
- Will be parsed into 4 tokens, 'This', 'text', 'contains', 'double quote (")'
Var SAMPLE_VAR_1="value with spaces" SAMPLE_VAR_2=no_spaces "NO_VAR=not_a_variable"
- Will be parsed into 4 tokens: 'Var,'SAMPLE_VAR_1="value with spaces"', 'SAMPLE_VAR_2=no_spaces' and 'NO_VAR=not_a_variable'. The second and third tokens will be further parsed into identifier/value pairs. The fourth token will not be parsed as it does not comply with the required format.
This design doesn't allow to specify a value with a trailing backslash:
Var SAMPLE_VAR="This is a backslash \"
The compiler reports an error because the trailing '\"' sequence is interpreted as escaped double quote instead of a backslash followed by the closing double quote. Version 4.4.4 introduced the '&bs;' keyword which gets replaced internally by a backslash:
Var SAMPLE_VAR="This is a backslash &bs;"
- The very first token is considered to be a command or procedure name and is matched against command and procedure tables. Command names are NOT case sensitive.
- Further processing and syntax validation are then performed by the command/procedure handlers as described below in the Command Syntax and Procedures chapters.