Amos Professional Manual  Contents  Index

Interface Language


JumpSubroutine
Interface instruction: call an Interface sub-routine
JS label;

The JumpSubroutine command calls up the sub-routine whose beginning is marked by the specified label number from zero to 65535. Sub-routines may be nested inside one another, with a maximum of 128 calls that can be made from each routine.

ReTurn
Interface instruction: return from an Interface sub-routine
RT;

An Interface sub-routine must be terminated by a ReTurn command. The Interface program will now re-commence from the command immediately after the initial JumpSubroutine call. If a ReTurn call is encountered out of sequence, an error will be generated.

Interface conditional tests

Constructing a test facility inside the AMOS Professional Interface is relatively simple.

IF
Interface structure: Mark start of conditional test
IF expression;[routine]

The familiar IF structure is followed by an Interface expression. When the expression results in a value of zero (False), any routine held inside the square brackets will be completely ignored, but if the expression is not zero (True) the bracketed routine will be executed immediately.

The expression is a normal Interface expression, and all values are taken from the stack in reverse order! The routine within the square brackets contains a list of normal Interface commands to be performed if the expression is true.

There is no limit to the size or the number of these commands, and JUmp as well as JumpSubroutine calls can be included. User-defined instructions may be accessed, and these are explained below. It is even possible to include another IF within the square brackets, and providing the number of opening brackets equals the number of closing brackets, all should be well. Here is a very simple example of a conditional test:

X> IF 0VA 1=; if the contents of variable zero is equal to one
   [PRint 0,0,'Variable 0 equals 1',5; then print a message]

Here is a table of the available testing operators that can be used for Interface conditional tests:

Operator    Meaning       Notes
=           equals        Gives -1 if two values are equal, otherwise gives zero
\           not equals    Gives -1 if two values are unequal. Do not confuse with /
<           less than     Gives -1 if the first value is less than the second value
>           greater than  Gives -1 if the first value is greater than the second value
&           logical AND
|           logical OR
Back    Next
09.02.07