PLBLinux Program Control


 

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 is then used to pass 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.

 

  1. If plb 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.

  2. If plb is executed with a program name, that program becomes both the ANSWER and MASTER for any subsequent programs chained to. If the program executes a STOP instruction, it returns control to the operating system.

  3. 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.

  4. 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.

  5. 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.

  6. Command line examples:

     

    plb

    Use the default screen definition file built by appending '.def' to the TERM environment variable entry and all the default PL/B environment characteristics therein (including the default printer device/file). Attempt to initiate the ANSWER to MASTER program concept by searching the Search Paths for the ANSWER and MASTER programs specified in the screen definition file in use.

     

    plb test

    Use the default screen definition file and then append the PL/B Code extension specified in the screen definition file to 'test' and attempt to load it from one of the Search Paths.

     

    plb -d answer.plc

    Use the default screen definition file and attempt to load 'sundbug.plc' from the PLB_SYSTEM directory. Once successful, attempt to load the program 'answer.plc' and corresponding symbol table file 'answer.sym' from within the Search Paths.

     

    plb -s scrndef.def MASTER.PLC

    Override the default screen definition file and use 'scrndef.def' in its place, then search the Search Paths for 'MASTER.PLC.

     

    plb -p /usr/spool/report1.lst report.plc

    Override the specified printer device/file name within the default screen definition file with '/usr/spool/report1.lst' in its place, then search the Search Paths for 'report.plc'.

     

    plb test.plc *.pls

    Use the default screen definition file and attempt to load 'test.plc' from one of the Search Paths. The argument to 'test.plc' is '*.pls'. Linux automatically expands the wildcard on the command line (*) and replace it with every matching file name in the current directory. As much of this information as fits is then placed in the system variable S$CMDLIN.

     

    plb -n test.plc <inkey >outdisp

    Use the default screen definition file and attempt to load 'test.plc' from one of the Search Paths. The '-n' option informs plb that the Linux hangup signal {SIGHUP(2)} is ignored. Any standard keyin input {stdin} is retrieved from 'inkey', while any standard screen output {stdout} is redirected to 'outdisp'.

     

    plb -r

    Return from a ROLLOUT searching for the file PORT####.ROL (where #### is the current port number) and maintaining the program specifics in effect at the time of the ROLLOUT.

 

 

See Also: Compiler and Runtime Options

 



Compiler and Runtime Options PLB Unix Program Execution PLB Unix Distributed Files