Previous Icon 3

Next Icon 3

Expressions in variables

The programming options in expressions are restricted. No local variables may be used.

Between the data types, the operators are defined in accordance with Table 64.1. A series of mathematical functions is also available. They are listed in table 64.2.

Data type

Operations

Description

Real

+,-

Addition and subtraction

 

*,/

Multiplication and division

 

<,>=,=,!=,>=,>

Relational operators

 

!,AND,OR

Logical operators

String

+,LEN

Concatenation and length operators

 

<,>=,=,!=,>=,>,!

Relational operators

Point

+,-

Addition and subtraction

 

*,**

Scalar and vector multiplication

 

:x,:y,:z

Access to components

 

LEN

Vector length

Array

[],+,LEN

Indexing, concatenation and length operator

Table 64.1: Permitted operators for data types

 

abs(x)

Supplies the value of x

sign(x)

Supplies the sign of x (+1, -1 or 0 if x=0)

min(a,b,...)

Supplies the smallest value of the arguments

max(a,b,...)

System supplies the largest value of the arguments

a_r(x)

System converts from degrees to radian measure

r_a(x)

System converts from curve to degrees

sin(x)

System calculates sin of x in the radian measure

sinh(x)

System calculates sinh of x

asin(x)

System calculates arcsin of x

cos(x)

System calculates cos of x in the radian measure

cosh(x)

System calculates cosh of x

acos(x)

System calculates arccos of x

tan(x)

System calculates tan of x in the radian measure

tanh(x)

System calculates tanh of x

atan(x)

System calculates arctan of x

atan(y,x)

System calculates arctan of y/x

exp(x)

System calculates e to the power of x

ln(x)

System calculates the natural logarithm of x

log(x)

System calculates the decadic logarithm of x calculates

sqrt(x)

System calculates square root of x

pow(x,y)

System calculates x to the power of y

fmod(x,y)

System calculates x modulo y

Table 64.2: Predefined mathematical functions

 

A variable's expression can contain the specified operations and any function calls. If limited expressions are to be used, the expression must begin with # and the result must be returned with RETURN:

# 
IF a>b THEN  
    RETURN a;  
ELSE  
    RETURN b;  
ENDIF