1.2.8 Using subroutines

Procedures may be defined to act as subroutines (see chapter The PROC statement for the syntax description). They are not bound to variables in this case. The CALL statement is used to invoke a subroutine from another procedure.

Subroutines are suitable to code operations which have to be done in the same way in several procedures. A common application for this is the check of the device's reply to a command. A subroutine can read the device's reply, check if it is OK and raise a fault flag if not. After a procedure sends a command to the device, it calls the subroutine which does the check.

When using subroutines, you should notice the following: