panSL main page

panSL language reference. Table of contents.

Operator

Operators are used in Formulas.

Note: As of April 2012 evaluation of Formulas is only at alpha-stage (still under development) in the panSL Implementations AgoRapide and MyLittleDatabase.
Operators are evaluated from left to right only.
Operator precedence is not supported at the moment, that is

2 + 3 * 4
evaluates to 20 not 14 (in other words multiplication and division is not done before addition and subtraction)
Use parantheses to correct this, that is use
2 + (3 * 4)
if a result of 14 is desired.

Field nameDescription

Addition

The Addition-operator + may be used on both strings and numbers.
number1 + number2

string1 + string2


Example:
2 + 2
results in 4.
"2" + "2"
results in "22".

Behaviour when adding a number and a string is not currently defined.
The StringFunction Concat may be used instead of Addition to ensure string-concatenation in such cases.

Division

number1 / number2


Example:
5 / 2
results in 2.5.

IsEqualTo

number1 = number2


Example:
5 = 5
results in "true".
5 = 2
results in "false".

For strings the function string1.Equals(string2) may be used.

See also function If and IfNot.

IsGreaterThan

number1 > number2


Example:
5 > 2
results in "true".
5 > 5
results in "false".

See also function If and IfNot.

IsLessThan

number1 < number2


Example:
2 < 5
results in "true".
2 < 2
results in "false".

See also function If and IfNot.

Multiplication

number1 * number2


Example:
5 * 2
results in 10.

Subtraction

number1 - number2


Example:
5 - 2
results in 3.

panSL language reference. Table of contents.

More samples available at http://panSL.org/samples/.

Last updated 2012-05-02