START @file
The START command instructs the program to stop reading commands from the
keyboard and start reading them from a procedure instead. This allows you to
store frequently-used commands in procedures, and to start the procedure
instead of retyping the commands. Essentially, this makes the program
programmable.
Procedures can start other procedures. This nesting can continue for up to eight levels, after which the program complains.
When the end of a procedure is reached, the next command is read from the procedure that started the current one. Procedures are popped until the last one is closed, at which point the prompt reappears and the next command is read from the keyboard.
The EXIT and STOP commands can be used to terminate a procedure before the end of the procedure is reached.
Let FILEA, FILEB, and FILEC be the following procedures. (Let A1, B1, etc.,
be generic commands.)
(FILEA) (FILEB) (FILEC) A1; B1; C1; A2; START FILEC; C2; A3; B2; C3; START FILEB; B3; A4; B4; A5;The command
START FILEAis equivalent to the sequence of commands
(A1) (A2) (A3) (B1) (C1) (C2) (C3) (B2) (B3) (B4) (A4) (A5)
Let FILEA, FILEB, and FILEC be the following procedures.
(FILEA) (FILEB) (FILEC) A1; B1; C1; A2; START FILEC; C2; A3; B2; EXIT; START FILEB; B3; C3; A4; STOP; A5; B4;The command
START FILEAis equivalent to the sequence of commands
(A1) (A2) (A3) (B1) (C1) (C2) (B2) (B3)The EXIT and STOP commands are used mainly for debugging procedures. (When debugging a procedure, it is not always necessary to read all the way through it.)