Script language String Variables Functions

See also Scripting Basics in the Tutorial Section

Variables

All variables are global – they are valid for all pages.

The variables are internally float (3.1415) not integer (3)

You don’t have to define variable – all variables have default value 0.

Example:

a = a + 1

See Also String Variables

Arrays

Variables can be in arrays:

Example:

A[1] = 0

A[b+1] = A[b]

You don’t have to declare the arrays and arrays can be also negative

You can use the basic operations * / + - etc…

Boolean operators = < > & |

The if - then statement

The if statement controls conditional branching. The body of an if statement is executed if the value of the expression is nonzero.

The keyword then is not required but it will be inserted there by the interpreter.

Expression can use any combination:

a<=b; a<>b; a=b; a=>b; a<b; a>b

You can use booleans & for and, | for or

if (a=b & a<10) then

end

...

The keyword end must close the inner code.

Example:

A = A+1

if (a>4) then

Show("text1")

Show("Rect1")

end

You can have if statement nested inside other if statements – but don’t do it if you can avoid it – the code will be messy

Important – there is no else command, you have to make another if statement instead.

For – next loop

The syntax is typical Basic syntax
Example:

for c = 1 to 5

next c

The loop can be counting up or down:

for c = 5 to 1

next c

To exit from the loop you can use the Return() command (this will exit the Script)

Infinite loop
In special cases (Semi-Parallel process) you may want to use infinite loop. It has syntax of:


for c = 0 to infinity

...

next c

For more about this reffer to the Semi-Parallel processes.

See functions

See String Variables