ANSWER and MASTER
This PL/B implementation supports an Answer/Master concept of program chaining. In typical PL/B installations, the first program executed after system startup is the ANSWER program, usually supplying system security. ANSWER then, either through program chaining or the occurrence of a STOP instruction, passes control to the main menu program, usually named MASTER. This program then passes control from one program selection in the menu to another, regaining control between program selections. With this concept of support in mind, certain rules must be understood about program chaining in order to insure its success.
If the interpreter is executed without a program name, it looks for the ANSWER program defined in the screen definition file. If that program then executes a STOP instruction, it attempts to chain to the MASTER program defined in the screen definition file. If unable to do so, it returns to the operating system.
If the interpreter is executed with a program name, that program becomes both the ANSWER and MASTER for any subsequent chained programs. If the program executes a STOP instruction, it returns control to the operating system.
Any program that is CHAINed to and that executes a STOP instruction, attempts to CHAIN to its MASTER program. If unable to CHAIN to its MASTER program, an attempt is made to CHAIN to its ANSWER program.
Any program that executes a DSCNCT instruction attempts to CHAIN to its ANSWER program. If unable to do so, it returns to the operating system.
Any program that executes a SHUTDOWN instruction returns control to the operating system and executes any given command line, if supported by the system in use.
See Also: Compiler and Runtime Options
![]() |