Expressions

Expressions can be real numbers (e.g. 3.4), hexadecimal numbers, starting with a $ sign (e.g. $00FFAA), strings between single or double quotes (e.g. 'hello' or “hello”) or more complicated expressions. For expressions, the following binary operators exist (in order of priority):

Note that value of x div y is the value of x/y rounded in the direction of zero to the nearest integer. The mod operator returns the remainder obtained by dividing its operands. In other words, x mod y = x - (x div y) * y. Also, the following unary operators exist:

As values you can use numbers, variables, or functions that return a value. Sub-expressions can be placed between brackets. All operators work for real values. Comparisons also work for strings and + concatenates strings. (Please note that, contrary to certain languages, both arguments to a Boolean operation are always computed, even when the first argument already determines the outcome.)

Example

Here is an example with some assignments.

{
  x = 23;
  color = $FFAA00;
  str = 'hello world';
  y += 5;
  x *= y;
  x = y << 2;
  x = 23*((2+4) / sin(y));
  str = 'hello' + " world";
  b = (x < 5) && !(x==2 || x==4);
}
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)