Amos Professional Manual  Contents  Index

Procedures


By pressing [Alt] and [Down Arrow] together, the edit cursor automatically jumps to the next procedure definition in your program. To jump to the previous procedure, press [Alt] and [Up Arrow] together. This shortcut works equally well with labels and line numbers!

If you are using several procedures on the same line, you can avoid the risk of a procedure being confused with a label by adding an extra space at the end of each statement. For example:

X> HEY: HEY: HEY: Rem Perform HEY procedure three times
   HEY: HEY: HEY: Rem Define label HEY and perform HEY procedure twice

PROC
structure: flag a procedure
Proc NAME

Another way to identify a procedure is to precede it with a PROC statement. Run the following example:

E> Rem Demonstrate that a procedure is being called not simply a command
   Proc HELLO
   Rem The same can be achieved without the Proc
   HELLO
   Procedure HELLO
    Print "Hey!"
   End Proc

It is possible to place the procedure definition anywhere in your program. When AMOS Professional encounters a procedure statement, the procedure is recognised and a jump is made to the final End Proc. In this way, there is no risk of executing your procedure by accident.

Opening and closing procedures
If a great many procedures are used, your listings may appear cluttered and confused by all of their definitions. Because of this problem, there is a simple method of "closing" a procedure. Self-contained procedures can be neatly hidden away inside your main program if you need to reduce the size and complexity of your listings.

Type in the following procedure on your editing screen:

E> MAIN_TITLE
   Procedure MAIN TITLE
    Curs Off
    Centre "Main Title"
    Say "Amos Professional presents."
    Fade 5
   End Proc

Run that if you like, and then return to the Edit screen.

Back    Next
05.05.02