Writing Formulas
A formula is a one-line statement that you can write either by typing directly the
appropriate syntax in the editor field or by selecting items from the editor
dictionary list. The formula syntax is easy to use and learn. Here are some details about
the objects provided in the dictionary.
Important note about real numbers
The period is generally used as a separator between the whole numbers and the fractional part of a number. Using a comma as a separator in place of the period is
not recommended in real values intended to be used directly in relations.
Example: Real1 = 2,1 + 5,4 is not allowed whereas Real1 = Real2 + Real3 is
allowed regardless of the separator used when valuating Real2 and Real3.
Writing Rules and Checks
Rules and checks are multi-line statements that you can write either by typing
directly the appropriate syntax in the editor field or by selecting items from the editor dictionary
list. Here is a description of the syntax to be used. The mathematical and trigonometric functions
as well as the functions to manipulate strings are the same as for formulas.
Conditional Statements
Rules
- if ... else ... else if
- Conditionally executes a group of statements, depending on the value of an expression. You
can use either block form syntaxes:
if condition statements [else elsestatements ] orif condition
{ statements }
[else if condition-n
[ { elseifstatements } ] ] . . .
[else
[ { elsestatements } ] ]
You can use the single-line form (first syntax) for short, simple rules. However, the block
form (second syntax) provides more structure and flexibility than the single-line form and is
usually easier to read, maintain, and test.
The else and else if clauses are both optional. You can have as many else if
statements as you want below a block if, but none can appear after the else clause.
Block if statements can be nested; that is, contained within one another.
Checks
statement1 => statement2 (if statement1 then
statement2)
Displays a message (if type is Warning or Information) and turns to red in the specification tree
each time statement2 is invalid as statement1 is fulfilled.
OK => KO |
|
KO => KO |
|
KO => OK |
|
OK => OK |
|
|