Amos Professional Manual  Contents  Index

AMAL


A value of -1 (true).is given if the Object is in motion, otherwise zero (false) is returned. When used with the Move instruction in AMAL, the CHANMV function can check whether a movement sequence has exhausted its steps. The sequence can then be started again at the new position, with an appropriate movement string. For example:

E> Load "AMOSPro Tutorial:Objects/Sprites.abk" : Get Sprite Palette
   Sprite 9,90,30,1
   M$="Move 300,150,150; Move -300,-150,75"
   Amal 9,M$ : Amal On
   While Chanmv(9)
   Wend
   Print "Movement complete!"

AMAL errors

AMALERR
function: give position of an AMAL error
position=Amalerr

The AMALERR function returns the position in the current animation string where an error has been found. It has been provided to allow the AMOS Professional programmer to locate and correct AMAL mistakes as quickly as possible. Type the following example exactly as it appears:

E> Load "AMOSPro Tutorial:Objects/Sprites.Abk" : Get Sprite Palette
   Sprite 8,100,100,1
   A$="L: IF X=300 Jump L; Pause; Let X=X+1; Jump L"
   Amal 8,A$ : Amal On : Direct

That example will generate an error, because IF will not be interpreted as an "If" structure, but as the two AMAL instructions I and F. To find the position in the animation string of this error, type the following line from Direct Mode:

D> Print Mid$(A$,Amalerr,Amalerr+5)

AMAL error messages
As soon as a mistake is encountered in an AMAL program, AMOS Professional will exit back to Basic with an appropriate error message. Here is a list of the errors that can be generated by this system, and an explanation of their most likely causes.

Bank not reserved
You have tried to call the PLay instruction but have forgotten to load a bank containing the movement data into memory. This should be created with the AMAL accessory program. If the PLay command is not in use, then check that any Pause and Let commands are separated in your listing.

Back    Next
07.06.20