Language basics
An ADAPL source code file consists of statements and possibly comments. The end of the main code is always marked by an end statement. Underneath the end statement, you may include any subroutines: subroutines are pieces of ADAPL code which start with a unique number and end with a return statement. These subroutines can be called from within the main code or other subroutines via the gosub # statement where # must be replaced by the number of the subroutine.
The code must be compiled before it can be run. When executed, the code is run through from top to bottom. Only when it reaches a gosub statement, execution jumps to the subroutine, runs through it and then jumps back to the line after the gosub.
Statements which start with * (only when at the first position in the line) and text following /* (may be preceded by spaces, tabs or ADAPL code) are regarded as comments and will be ignored by the compiler. Comments start and end on the same line. You can use comments to include additional details in the program text about what the program is supposed to do.
You can use tabs, blanks and empty lines wherever you wish to ensure that the source code is readable.
Upper and lower case are considered equal in instructions and functions, but not in strings and variable names: the variable Counter is not the same as the variable counter.
ADAPL source code can be divided between various files. In that case, the compiler will temporarily go to another file during compilation, and go back to compiling the first file as soon as that file has been compiled. The command used for this is include.