Amos Professional Manual  Contents  Index

AMAL


By changing the values in these registers, the Object can be moved around the screen and animated. Here is an instant example:

LD> Load "AMOSPro_Tutorial:Tutorials/AMAL/AMAL_2.AMOS"

Logical decisions
You can trigger a Jump to a label as the result of a simple test performed in an AMAL program.

IF
AMAL structure: perform a test
If test Jump label

If the expression in a test is -1 (True), the AMAL program will jump to the specified label, otherwise a value of zero (False) will result in the execution of the AMAL instruction immediately after the test.

Unlike a standard AMOS Professional structure, you are limited to a single jump after the test.

It is common to pad out this sort of instruction with some lower-case words, which make the program appear more familiar, but will be ignored by AMAL. If you do add spurious words like "then" or "else" you must remember not to use capital letters. For example:

X> If X>10 then Jump Label else Let X=Y"

Tests can be any logical expression, and may include the following characters:

=  equal
>  greater than
<  less than
<> not equal

Note that AMAL expressions can include all of the normal arithmetic operations, except MOD. So a logical AND (&) and a logical OR (|) may be used in AMAL expressions.

Do not try to combine several tests into a single AMAL expression using the ampersand (&) or upright (|) characters.

FOR
TO
NEXT
AMAL structure: loop within AMAL program
For register=start To end ... Next register

This structure is almost identical to Basic's FOR ... NEXT loops. The specified register can be any of the internal registers from RO to R9, or any external register from RA to RZ. Special registers cannot be used. Loops may be nested as usual, but the step size of a loop can only be set to 1.

Back    Next
07.06.05