Basic Syntaxby Group Public on Saturday February 06 2010 @ 10:24:02 (1/1 Points) |
|
| Language ↪Reference ✑ Reply ✓ Stick It ✗ Ditch It ⚐ Tag It |
.test is a line based language: an end-of-line signifies the end of the current instruction. Additionally parameters are generally space separated. This was found to be cleanest method for test scripts; it produces easy-to-read code.
# A comment set %Value% 123 GotoURL http://bigtpoker.com/
Also note that whitespace at the beginning and end of lines is generally ignore. It is nonetheless recommend to use indentation to organize code blocks -- you'll see this when using with→ or if→ clauses.
Comments
Any line which beings with a # is treated as a comment. It has no impact on the code. Note that this only applies when the # character appears at the beginning of the line. Later in the line the symbol is treated as part of command.
Continuing Lines
If you need to continue one line on the next you can use the \ character. Do note however that the space stripping still applies on the next line, but all space prior to the \ will be preserved in string parameters.
For example:
Notice Hello \
thereOutputs:
00000000-00 NOTICE Hello there
Heredoc
If you wish to embed a longer piece of text in the file you can do this with a heredoc syntax. You can open a heredoc with <<EOF where the EOF part can actually be any string you wish. Then, starting on the next line, all the text until the the matching EOF is taken as a string. All space inside this area is preserved.
Notice <<EOF
Hello:
There
Where
EOFThe final EOF must appear on a line by itself.
You may find that a heredoc is not suitable in many cases. There are also several other ways for Loading Files→.
Variables
Context items→ are comparable to traditional variables. The basic way to assign a value to an item is to use the set→ command.
set %Count% 123 set %URL% http://bigtpoker.com/
Note that items are typed, but that dynamic conversion is performed in most cases. For example the first line above creates the string 123, but any numeric operations will simply convert that to a number and perform the operation. In general you don't have to worry about types too much.
Beyond simply strings you can also create vectors and maps. Refer to set→ for that syntax.
Keywords
Refer to the list of Keywords→.
TestPlan Basic Syntax
