Syntax
Test instructions with arithmetic operations have the following structure:
num |
countErrors |
= |
countErrors |
+ |
1 |
num |
argument1 |
operator1 |
argument2 |
[ operator2 |
argument3 ] |
num |
Keyword, marks the test instruction as a computing operation or a comparison operation |
argument1 |
The name of a variable If the variable does not exist:
|
operator1 |
Either an assignment operator (=), or an operator for comparing two numerical values or expressions (<, <=, ==, !=, <>, >=, >), or an operator for comparing a numerical value with an interval (in, !in) |
argument2 |
The name of an already existing variable, or a number, or an interval |
Optional: operator2 argument3 |
An operator for basic arithmetic operations (+, -, *, /) and the name of an existing variable or a number |
Examples |
|
|---|---|
num countErrors = 0 |
Assignment: Value 0 is assigned to the variable countErrors. |
num countErrors = countErrors + 1 |
Assignment: The value of the variable countErrors is increased by 1 |
num itemVAT = itemNet * 19% |
Assignment: VAT is calculated from the net amount |
num countErrors > 0 |
Comparison: Checking whether the value of the variable countErrors is greater than 0 |
num countErrors in [ 1 : 5 ] |
Comparison: Checking whether the value of the variable countErrors falls within the specified interval, i.e. is greater than or equal to 1 and smaller than or equal to 5 |
Additional notes
-
Case sensitivity is irrelevant for keywords and variable names
-
Until further notice, numerical values must be specified in a technical format, just like e.g. double values in Java:
-
no thousands separators
-
no commas; dot is used as the decimal separator
-
as in the following example: 5123.25
-
-
If a numerical value is followed by the percent symbol, the value is automatically divided by 100 internally:
-
i.e. 5% is turned into 0.05
-
-
In order for a condition value to be considered valid (i.e. executable), all arithmetic or comparison operations assigned to this condition value must have been successfully executed, see also the example in the previous chapter