XML Script logo next up prev
Operators
Description

X-Tract has a large range of built-in operators for mathematical and boolean operations. For further details of individual operators, see the documentations for built-in functions. Note that there must always be whitespace between an operator and its operands.

Example

Syntax: expr1 + expr2

2 + 2

Adds expr1 and expr2

Example

Syntax: expr1 - expr2

3 - 2

Subtracts expr2 from expr1

Example

Syntax: expr1 * expr2

2 * 2

Multiplies expr1 and expr2

Example

Syntax: expr1 / expr2

4 / 2

Divides expr1 by expr2

Example

Syntax: expr1 % expr2

3 % 2

Finds the modulus when expr1 is divided by expr2

Example

Syntax: expr1 ^ expr2

2 ^ 2

Raises expr1 to the power expr2

Example

Syntax: ! expr

! 0

Inverts expr

Example

Syntax: expr1 == expr2

1 == 1

Returns true if expr1 is equal to expr2

Example

Syntax: expr1 eq expr2

1 eq 1

Returns true if expr1 is equal to expr2

Example

Syntax: expr1 != expr2

1 != 1

Returns true if expr1 is not equal to expr2

Example

Syntax: expr1 neq expr2

1 neq 1

Returns true if expr1 is not equal to expr2

Example

Syntax: expr1 and expr2

1 and 1

Returns true if expr1 and expr2 are true

Example

Syntax: expr1 or expr2

1 or 1

Returns true if expr1 or expr2 are true

Example

Syntax: expr1 gt expr2

1 gt 0

Returns true if expr1 is greater than expr2

Example

Syntax: expr1 lt expr2

1 lt 0

Returns true if expr1 is less than expr2

Example

Syntax: expr1 gte expr2

1 gte 0

Returns true if expr1 is greater than or equal to expr2

Example

Syntax: expr1 lte expr2

1 lte 0

Returns true if expr1 is greater than or equal to expr2

Example

Syntax: item := expr

f := 1

Sets the value of item to be expr

Example

Syntax: ++ item

++ f

Increments item

Example

Syntax: -- item

-- f

Decrements item

Example

Syntax: item += expr

f += 2

Increases item by expr

Example

Syntax: item -= expr

f -= 2

Decreases item by expr

Example

Syntax: item /= expr

f /= 2

Divides item by expr and assigns the result to item

Example

Syntax: item *= expr

f *= 2

Multiplies item by expr and assigns the result to item

Example

Syntax: item %= expr

f %= 2

Finds the modulus when item is divided by expr and assigns the result to item

Example

Syntax: item ^= expr

f ^= 3

Raises the item by the power expr and assigns the result to item

Next...

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited