Marking the bones of a program
Imagine that the skeleton of your latest programming masterpiece is so clever and so
complex that you cannot remember where everything is or what anything is supposed to do! There is
a simple and effective way of marking any part of an AMOS Professional program, by inserting
typed messages to remind yourself exactly what this section of program is for. These
little comments or messages are known as "Rem statements".
REM
structure: insert a reminder message into a program
Rem Typed in statement
' Typed in statement
The beginning of a Rem statement is marked by REM or by the apostrophe character, which is simply a short-cut recognised by AMOS Professional as a REM. The message or comment is then typed in from the keyboard, beginning with a capital letter. Here are some examples:
X> 'An apostrophe can be used instead of the characters Rem Rem The next line will print a greeting Print "a greeting" 'This line is a comment that does nothing at all Wait 75: Rem Wait one and a half seconds 'Return to the Edit Screen Edit
These reminders are for human intelligence only, and when a Rem statement is encountered in a program, it is completely ignored by the computer.
Rem statements can occupy their own line, or be placed at the end of a line of the program, as long as they are separated from the last instruction by a colon. But the apostrophe character can only be used to mark a Rem statement at the beginning of a line. The first of the next two lines is fine, but the second will create an error:
X> Print "This example is fine" : Rem Fine example Print "Wrong!" : ' This is illegal