Click or drag to resize
TOPICA Basic Operators

[This is preliminary documentation and is subject to change.]

TOPICA Basic supports most of the usual operators commonly found in programming languages.

Arithmetic operators

Operator

Description

+

Functionality depends on type of operands:

  • Addition (when both operands are numbers).

    When both operands are type Integer, the result is type Integer.

    When both operands are type Double, the result is type Double.

    When one operand is type Integer and the other operand is type Double, the result is type Double.

  • String concatenation (when both operands are type String).

    If one operand is null, an exception is thrown.

-

Subtraction

*

Multiplication

/

Division.

When both operands are type Integer, the result is also of type Integer.

When one or both operands are type Dobule, the result is of type Double.

Mod

Modulus operator (for integer operands only)

^

Power

Comparison operators

Operator

Description

=

"Equal" operator

<

"Less than" operator

<=

"Less than or equal" operator

>

"Greater than" operator

>=

"Greater than or equal" operator

Logical operators

Name

Description

And

Logical And

Or

Logical Or

Not

Logical Not

Note that Not may also be used as a function (same functionality, but different syntax).