Start MPR software reference manual at next page M P R ======= Software Reference Manual Version V1.1 November 1983 This document describes how to use the Menu Processing Routines (MPR). It provides the information required to design menu's for display on a video terminal and to develop programs that use MPR-menu for controlling the execution of functions. Contents CHAPTER 1 Introduction to MPR 1.1 Overview . . . . . . . . . . . . . . . . . . . . . 1-1 1.2 Menu source file . . . . . . . . . . . . . . . . . 1-2 1.3 Menu compiler . . . . . . . . . . . . . . . . . . 1-2 1.4 Menu driver subroutines . . . . . . . . . . . . . 1-2 CHAPTER 2 Menu source file 2.1 Overview . . . . . . . . . . . . . . . . . . . . . 2-1 2.2 Terminology . . . . . . . . . . . . . . . . . . . 2-2 2.2.1 Screen menu . . . . . . . . . . . . . . . . . . 2-2 2.2.2 Menu description . . . . . . . . . . . . . . . . 2-2 2.2.3 Function . . . . . . . . . . . . . . . . . . . . 2-2 2.2.4 Function-list . . . . . . . . . . . . . . . . . 2-2 2.2.5 Menu source file . . . . . . . . . . . . . . . . 2-2 2.2.6 Menu library file . . . . . . . . . . . . . . . 2-2 2.2.7 Menu document list file . . . . . . . . . . . . 2-3 2.3 Menu description language . . . . . . . . . . . . 2-3 2.3.1 SYS-record . . . . . . . . . . . . . . . . . . . 2-3 2.3.2 GEN-record . . . . . . . . . . . . . . . . . . . 2-4 2.3.3 MEN-record . . . . . . . . . . . . . . . . . . . 2-4 2.3.4 FUN-record . . . . . . . . . . . . . . . . . . . 2-5 2.3.5 SUB-record . . . . . . . . . . . . . . . . . . . 2-5 2.3.6 FSB-record . . . . . . . . . . . . . . . . . . . 2-6 CHAPTER 3 Menu compiler 3.1 Running the compiler . . . . . . . . . . . . . . . 3-1 3.2 Output from the compiler . . . . . . . . . . . . . 3-3 3.2.1 Menu library file . . . . . . . . . . . . . . . 3-3 3.2.2 Menu document list file . . . . . . . . . . . . 3-3 3.2.3 Generated subroutine . . . . . . . . . . . . . . 3-4 3.2.4 Error messages . . . . . . . . . . . . . . . . . 3-5 CHAPTER 4 Introduction to the menu driver subroutines 4.1 Menu driver subroutine interaction with menu source file . . . . . . . . . . . . . . . . . . . 4-1 4.1.1 Program access to menu's . . . . . . . . . . . . 4-2 4.1.2 Defining menu's by name . . . . . . . . . . . . 4-2 4.1.3 Displaying the menu . . . . . . . . . . . . . . 4-2 4.2 Menu driver subroutine interaction with terminal operator . . . . . . . . . . . . . . . . . . . . . 4-2 4.2.1 Menu control keys and functions . . . . . . . . 4-3 4.2.1.1 The EXIT function . . . . . . . . . . . . . . . 4-3 4.2.1.2 Return to main menu . . . . . . . . . . . . . . 4-3 4.2.1.3 Return to previous menu . . . . . . . . . . . . 4-4 4.2.1.4 The HELP function . . . . . . . . . . . . . . . 4-4 4.2.2 Breaking through . . . . . . . . . . . . . . . . 4-4 CHAPTER 5 Menu driver subroutine calls 5.1 MPREND - close library . . . . . . . . . . . . . . 5-1 5.2 MPRMEN - start menu control . . . . . . . . . . . 5-1 5.3 MPRMES - put message on menu screen . . . . . . . 5-2 5.4 MPRRST - restore menu status (RT-11 only) . . . . 5-2 5.5 MPRSAV - save menu status (RT-11 only) . . . . . . 5-3 CHAPTER 6 Software example 6.1 Create menu source file . . . . . . . . . . . . . 6-1 6.2 Create menu library file . . . . . . . . . . . . . 6-2 6.3 Write FORTRAN IV application program . . . . . . . 6-2 CHAPTER 7 System internals 7.1 System subroutines . . . . . . . . . . . . . . . . 7-1 7.2 System size . . . . . . . . . . . . . . . . . . . 7-2 7.3 Overlay requirements . . . . . . . . . . . . . . . 7-2 CHAPTER 1 Introduction to MPR 1.1 Overview MPR is a set of Menu Processing Routines. MPR software contains the tools for developing menu controlled applications and running them on a video terminal. MPR software now brings the speed, convenience, accuracy and low cost of computerized processing to users who, in the past, have been building the same kind of controlling mechanism more than once. MPR is written in FORTRAN IV for RT11/RSTS and FORTRAN IV+ for RSX-11M. Although MPR is developed for use on a VT100-compatible terminal, it is not complicated to modify the package to be used with other scope terminals. Menu's are designed by the use of a menu description language described furtheron in this manual. MPR associates constant data with the menu lay-out, not with the application program, resulting in simplified application program maintenance and increased application program flexibility. Some menu lay-out paramenters can later be modified without the need to recompile the application program. MPR software has three main components for developing and executing menu-controlled application programs: - menu source file - menu compiler - menu driver subroutines Introduction to MPR page 1-2 1.2 Menu source file The menu source file contains records which describe the menu's as a whole by defining the function-list (function keywords and a short description of the action: execute subroutine or submenu). These records are legible ASCII-character strings (menu description language), and can be created and/or modified by any available text editor. When designing menu's, you assign a menu name, function keywords, subfunction- and/or subroutine-name for function execution and explanatory text to that function. 1.3 Menu compiler The menu compiler MPR allows you to create and modify menu libraries and versions of menu descriptions that are suitable for hard-copy listings (menu document list file). It also generates a FORTRAN subroutine source necessary for the application subroutines being controlled by the menu driver subroutines. 1.4 Menu driver subroutines The menu driver subroutines is a set of routines that permits your application program to access menu's from a menu library created by the menu compiler. Application programs access a menu library by issuing a menu driver subroutine call that is embedded in the program and written in the source language of the program. A menu driver subroutine call refers to a specific menu library file by the name you assigned to that library file. CHAPTER 2 Menu source file 2.1 Overview Using any text editor available on your system and the menu description language, you can create, modify and store customized menu's. Your application programs can use these menu's to control the execution of functions. Creating or editing a menu is an interactive and iterative process. You can test the various possibilities by observing the menu document list file or by testing your design using a small test program (see software example elsewhere). The product of your editor work is one or more menu descriptions in the menu source file, that can be translated by the menu compiler into the menu library file. The menu descriptions can be retrieved from the menu source file for additions or modifications. You can change text portions of the menu without affecting the logic of the execution of functions. For example, you might want to translate the text of a menu into another language, reposition items on the screen to make the menu more attractive to the eye or easier for an operator to handle, remove text, or supply additional information. You can make these and other changes by editing the menu source file and recompile it into the menu library file. The purpose of the menu description is to provide information to another software component: the menu driver subroutines. This routine handles the interaction of the terminal operator with the menu displayed on the screen and with the application program. Menu source file page 2-2 2.2 Terminology 2.2.1 Screen menu The screen menu looks like a paper menu but is instead a video display. The computer displays a menu by using a menu description that specifies to the computer which functions to display on the screen. 2.2.2 Menu description The menu description is the computer's specifications of a screen menu. It specifies the name of the menu, which functions the menu offers and how the functions on the menu are processed. 2.2.3 Function A function is a subroutine or a submenu which can be selected for execution by entering the appropriate function keyword. 2.2.4 Function-list A function-list is a set of lines on the menu showing the function keys that can be selected and an explanation to every key. 2.2.5 Menu source file The menu source file is a computer file that contains one or more menu descriptions in legible ASCII format (menu description language). It can be modified by the use of any text editor and must be compiled by the menu compiler in order to make the menu description(s) processable by the menu driver subroutines. 2.2.6 Menu library file The menu library file is a computer file containing at least one menu description. It is a binary file is arranged so individual menu descriptions can be accessed by the menu driver subroutines. Menu source file page 2-3 2.2.7 Menu document list file The menu document list file is a legible ASCII file showing full documentation on the contents of a menu library file (menu names, menu screen lay-outs, function keys and functions) and the complete menu/submenu structure: the menu tree. 2.3 Menu description language The menu description language is the language used to describe menu's in the menu source file. It is legible ASCII format and can be created and/or modified by any text editor available on the system. Every menu description record contains a record type code and one or more data items which hold the describing information. Record type code and data items within one record are mutually separated by comma's. Text-strings (always the last data item in a description record) may contain comma's without being considered as data item separators. Description records may have a maximum length of 127 characters. Record type code and menu name may appear in upper-case, lower-case or mixed-case, and are transferred to upper-case by the menu compiler. Text-strings are not modified in any way. 2.3.1 SYS-record The SYS-record defines the system header line displayed at the top of all menu's and submenu's showing application-defined text (system header), subroutine identification, date and time. It has following format: SYS , syst.header where: SYS is the record type code. syst.header is the system header text-string (max. 53 characters). Menu source file page 2-4 2.3.2 GEN-record The GEN-record defines the general header line displayed under the system header line at the top of all menu's and submenu's and has following format: GEN , gen.header where: GEN is the record type code. gen.header is the general header text-string (max. 40 characters) displayed centered over the second and third screen row in reversed video. 2.3.3 MEN-record The MEN-record defines de start of a new menu description in the menu source file and has following format: MEN , name , menu-header where: MEN is the record type code. name is the name of the menu (max. 6 characters). This is the name by which the menu is referred to by a function key in a menu one level higher. menu-header is the text-string that identifies the menu (max. 40 characters) and is displayed centered below the general header line. Menu source file page 2-5 2.3.4 FUN-record The FUN-record defines a routine that can be selected from the function-list and has following format: FUN , routine , list-line where: FUN is the record type code. routine is the name of the subroutine to be executed (max. 6 characters). list-line is the text-string (max. 79 characters) that contains the function key and its explanation. The first characters of the list-line until the occurrence of a hyphen will be considered as the function key (max. 5 characters). The hyphen will not be displayed. 2.3.5 SUB-record The SUB-record defines a submenu that can be selected from the function-list and has following format: SUB , menu , list-line where: SUB is the record type code. menu is the name of the submenu to be displayed (max. 6 characters). list-line is the text-string (max. 79 characters) that contains the function key and its explanation. The first characters of the list-line until the occurrence of a hyphen will be considered as the function key (max. 5 characters). The hyphen will not be displayed. Menu source file page 2-6 2.3.6 FSB-record The FSB-record defines a function (first subroutine than submenu) that can be selected from the function-list and has following format: FSB , routine , menu , list-line where: FUN is the record type code. routine is the name of the subroutine to be executed (max. 6 characters). menu is the name of the submenu (max. 6 characters) to be displayed after the execution of the subroutine. list-line is the text-string (max. 79 characters) that contains the function key and its explanation. The first characters of the list-line until the occurrence of a hyphen will be considered as the function key (max. 5 characters). The hyphen will not be displayed. CHAPTER 3 Menu compiler The menu compiler is the only program that creates and modifies menu library files. The compiler should be used when you want to examine the contents of a menu library file. The compiler provides following sevices: - Translates a (legible ASCII) menu source file into a (binary) menu library file. - Creates a menu document list file, showing the contents of the menu library file. - Creates a FORTRAN subroutine source which, when compiled and linked to the application program, controls the execution of subroutines. 3.1 Running the compiler To run the compiler type: RUN MPR The compiler returns with an identification and asks for a source file name and whether a menu library file, a document list file and/or a FORTRAN subroutine source should be made. The programs for RSX and RT11 ask their questions differently. RSX asks wether the output files must be created or not, while RT11 asks for the device where the output files must be written to. Both create the output files with fixed filenames depending on the source filename. Menu compiler page 3-2 For RT11 : Source file : If a name is entered without extension, the compiler will search for the existence of a file with extension ".MEN". Device Library file : Enter the divice where the compiler must write its library file with extension ".MEX". Default is no library file. Device Document file : Enter the divice where the compiler must write its document list file with extension ".MLS". Default is no document file. Device FORTRAN-routine file : Enter the device where the compiler must write its FORTRAN subroutine source file with extenion ".GMX" containing subroutine MPREXE. Default is no FORTRAN file. For RSX : Source file : If a name is entered without extension, the compiler will search for the existence of a file with extension ".MEN". Library file : If Yes is entered the compiler will create a library file with extension ".MEX". Default entry is "Y". Document file : If Yes is entered the compiler will create a menu document list file with extension ".MLS". Default entry is "Y". FORTRAN-routine: If Yes is entered the compiler will create a FORTRAN subroutine source file with extension ".GMX" containing subroutine MPREXE. Default entry is "Y". Now the compiler prints all the names of the menu encountered in the menu source file and the eventual error messages. Menu compiler page 3-3 3.2 Output from the compiler 3.2.1 Menu library file The menu library file is the only file used by the menu driver subroutines, and must have the extension ".MEX" in order to be acessable. 3.2.2 Menu document list file The menu document list file is a legible ASCII printfile showing the contents of the menu library file and the menu/submenu structure (menu tree). For every menu in the library file it shows two types of information: - screen lay-out with general and menu header, and the function-list. - function key information showing the subroutine and/or submenu name being executed resp. displayed upon selection. Menu compiler page 3-4 3.2.3 Generated subroutine In order to make it possible for the menu driver subroutines to execute application subroutines upon operator request, the compiler generates a FORTRAN subroutine source to provide that service. This subroutine, with the entry name MPREXE, will be created in a file with the same name as the menu source file and the extension ".GMX". For correct execution of the application program, compile this source and link it to the application. Every application routine must have an argument list with one INTEGER parameter: the return-code. The return code of an application subroutine can have following values: 0 - screen is not modified by the subroutine and will therefore not be re-displayed (special return). 1 - menu screen will be re-displayed (normal return). For functions defined by a FSB-record only there is a possibility, in case of a failure during execution of the subroutine, to return to the calling (=previous) menu in stead of returning to the menu defined in the function-list: 2 - return to previous menu without re-displaying the menu. 3 - return to previous menu and re-display. Menu compiler page 3-5 3.2.4 Error messages If the compiler discovers soft or hard errors during compilation of the menu source file, it can issue three kinds of messages to the terminal screen and to the menu document list file (if active): W (warning) invalid data replaced by compiler defaults. E (error) invalid data send to the library (if active) which will result in erroneous execution of the menu driver subroutines. F (fatal error) non-recoverable error, resulting in compiler execution halt. Error messages have following lay-out: ?MPR-t-[record type code/[name/]] message-text where: t is the error type code: W, E or F. record type code is the identification of the menu description record where the error was found. name is the name of the subroutine or submenu where the error was detected. CHAPTER 4 Introduction to the menu driver subroutines The menu driver subroutines form a set of routines as a subcomponent of your program. In an application that uses video images of menu on the terminal screen, using the menu driver subroutines can reduce your programming effort by manipulating the screen, displaying help-messages when the operator requests them or showing information lines under application program control. This chapter discusses how the menu driver subroutines interacts with: - the menu description as created in the menu source file. - the terminal operator, who requests action by entering a function key. Throughout the chapter, programming requirements are mentioned and specific subroutine calls are mentioned occasionally but not fully described. In the next chapter full description is presented for the calls. 4.1 Menu driver subroutine interaction with menu source file This section describes how the menu driver subroutines use menu's to display submenu's or execute functions, guide the operator through the menu tree, and process the responses that the operator types in. The term "menu" refers to the image that the operator sees and to the computerized menu description that the menu driver subroutines handle internally. Introduction to the menu driver subroutines page 4-2 4.1.1 Program access to menu's Your program uses menu's by issuing menu driver subroutine calls that reads menu descriptions from the menu library file that has been stored on a mass storage volume, such as a disc. Menu descriptions created in the menu source file must be translated by the menu compiler into the menu library file, in order to be accessable by the menu driver subroutines. 4.1.2 Defining menu's by name The name that you assign to a menu in the menu source file is the only information that the menu driver subroutines needs to read the menu from the menu library file. The name that you assign to a function-list line in the menu source file is all the menu driver subroutines require, regardless of where you locate the name within the function-list. As long as changes to the menu lay-out have no effect on the logic of your programs, you can change the function-list lines without having to modify your programs. 4.1.3 Displaying the menu After an MPR application program issues the MPRMEN call the first (main) menu of the file will be displayed. Any request for submenu's from the function-list will be served as soon as the appropriate key is entered by the operator. 4.2 Menu driver subroutine interaction with terminal operator After the application program issues the MPRMEN- or MPRRST-call for a menu, the operator can select a function by entering the associated function key(word). If this function results in executing a subroutine, the menu mechanism will act accordingly and after the subroutine is executed the return from that subroutine will be the request for an operator response (what function next), after, if the return-code of the executed subroutine requests so, a re-display of the menu. If the selected function is a submenu, that menu will be displayed, and a new function can be selected. When the operator terminates the MPR application by using the EXIT function, control is returned main program of the application. Introduction to the menu driver subroutines page 4-3 4.2.1 Menu control keys and functions Table 1 summarizes the menu control functions that the menu driver subroutines provide, and lists the key(words) that control the functions. These functions are executed entirely by the menu driver subroutines. Table 1: Menu control keys and functions ------------------------------------------------------ Key(word) Function ------------------------------------------------------ "EXIT" Leave main menu and return control to or "EX" the main program (main menu only). "<" Return to main menu. "." Return to previous menu (one level higher). "?" Display help text. function- Execution of the selected function. list keyword ------------------------------------------------------- 4.2.1.1 The EXIT function When the operator wishes to stop the MPR application program he can enter the function key "EX" or "EXIT" in order to leave the menu driver subroutines and return control to the main program. This function, which is not defined by a function-list line, is valid for the main menu only. 4.2.1.2 Return to main menu By entering the "<"-character the menu driver subroutines return control to the first (main) menu in the menu library file. Introduction to the menu driver subroutines page 4-4 4.2.1.3 Return to previous menu By entering the "."-character the menu driver subroutines return control to the previous menu (one hierarchy level higher) in the menu library file. 4.2.1.4 The HELP function Whenever the operator requests help by entering the "?"-character, the menu driver subroutines will display a help text for the current menu. 4.2.2 Breaking through When the operator is familiar with a path, starting at any menu level leading up- and/or down-wards through several submenu's, to a specific function, he can enter that path directly by specifying all keys defining that path separated by comma's (break-through). The menu driver subroutines will step up/down the path as specified and executes the final function or stops at the final submenu by displaying it on the terminal screen. If one of the keys appears to be invalid, while analyzing a break-through command string, the menu driver subroutines display the last valid menu in the path so far, and issues an error message for the invalid key(word). CHAPTER 5 Menu driver subroutine calls The whole menu/submenu mechanism is controlled by the menu driver subroutines: MPRMEN and eventually MPRRST in combination with MPRSAV. The other available subroutine call: MPRMES, is a utillitarian subroutine for application subroutines to put messages on a displayed menu. The descriptions below show what each call does, what input arguments it requires, and what output it returns to your program. For each call, syntax is indicated. 5.1 MPREND - close library This routine should be the last MPR-call in the program before the program exits. CALL MPREND 5.2 MPRMEN - start menu control The menu driver subroutines clear the terminal screen, display the first (main) menu in the menu library file, ask for operator response and control function handling. CALL MPRMEN (file, unit) where: file is a STRING containing the name (max. 6 characters), eventual with device but without the extension of the menu library file wanted. The extension ".MEX" will be assigned by the subroutine. unit is the INTEGER logical unit number for the file. Menu driver subroutine calls page 5-2 5.3 MPRMES - put message on menu screen The menu driver subroutine displays a message on the error/help-message screen position (rows 22-24 column 1-80). After any response on function request, the message will be cleared. CALL MPRMES (message) where: message is a STRING containing the message. A maximum of three lines (i.e. part of a string concluded by a carriage-return/linefeed) with a maximum of 79 characters per line is permitted. 5.4 MPRRST - restore menu status (RT-11 only) The menu driver subroutine restores the status of a menu application, saved by MPRSAV, after a 'RUN' or 'CHAIN', and continues menu processing. CALL MPRRST (file, unit, newpage) where: file is a STRING containing the name (max. 6 characters), eventual with device but without the extension of the menu save-file wanted. The extension ".MAV" will be assigned by the subroutine. unit is the INTEGER logical unit number for the file and becomes automatically the new unit number for the menu library file. newpage is an INTEGER indicating whether the menu must be (re-)displayed on the screen or not (1 resp. 0). Menu driver subroutine calls page 5-3 5.5 MPRSAV - save menu status (RT-11 only) The menu driver subroutine can save the actual status of the menu-tree on a menu save-file and makes it possible to 'CHAIN' from program to program and continue the menu processing as if all programs belonged to one big load-module. The menu library will be closed by this routine. CALL MPRSAV (file) where: file is a STRING containing the name (max. 6 characters), eventual with device but without the extension of file on which the menu status must be stored. The extension ".MAV" will be assigned by the subroutine. CHAPTER 6 Software example MPR programs must be written according to the rules of the specific language used. Programmers should consult their language reference manual for this information. The next step to running an MPR application is linking the program to the menu driver subroutines and the generated FORTRAN subroutine, so that the calls to the menu driver subroutines and the application function subroutines will be processed properly. 6.1 Create menu source file Create a menu source file (DEMO.MEN), using any available text editor, with following contents: SYS , System, company c.q. department GEN , MPR-DEMO MEN , MENU00 , Main menu SUB , MENU01 , A- Submenu 1 FUN , ROUT01 , B- Application routine 1 FSB , ROUT02 , MENU02 , C- Routine 2, then Submenu 2 MEN , MENU01 , Submenu 1 FUN , ROUT03 , one- Application routine 3 FUN , ROUT04 , two- Application routine 4 MEN , MENU02 , Submenu 2 FUN , ROUT05 , thi-s is routine 5 that CHAINs FNCTIO FUN , ROUT06 , tha-t is routine 6 Software example page 6-2 6.2 Create menu library file Compile this menu source file using the MPR compiler, creating a library file (DEMO.MEX) with three menu's, the menu document list file (DEMO.MLS), and the FORTRAN subroutine source (DEMO.GMX). RUN MPR MPR-menu compiler - V1.1 dd-mmm-yy time hh:mm:ss RT11 RSX Source file : DEMO Source file : DEMO Device Library file : DK: Library file : Device Document file : DK: Document file: Device FORTRAN routine : DK: FORTRAN routine: MENU00 MENU00 MENU01 MENU01 MENU02 MENU01 6.3 Write FORTRAN IV application program Create a FORTRAN IV test programs (main routines): PROGRAM MPRDEM C C Carry out initialization activities C CALL RCHAIN(IFL,IVAR,1) C IF (.NOT. IFL) CALL MPRMEN ('DEMO',20) ! start IF (IFL) CALL MPRRST ('SAVDEM',20,1) ! cont. C C Close files etc. C STOP END PROGRAM FNCTIO C TYPE *,'Here is program FNCTIO' C C Chain back to MPRDEM C Close all currently open files first! C CALL CHAINF('MPRDEM.SAV',arg2,arg3) END Software example page 6-3 Now create the application subroutines executing the functions as described by the explanations for every function key in the function-list of the menu: SUBROUTINE ROUT01 (IRET) C Set-up new screen, get data, process etc. IRET=1 ! normal return RETURN END SUBROUTINE ROUT02 (IRET) C Execute 'background'-function CALL MPRMES('Routine 2 was executed') IRET=0 ! special return RETURN END SUBROUTINE ROUT03 (IRET) C Set-up new screen, get data, process etc. IRET=1 ! normal return RETURN END SUBROUTINE ROUT04 (IRET) C Execute 'foreground'-function CALL MPRMES('Routine 4 was executed') IRET=0 ! special return RETURN END SUBROUTINE ROUT05 (IRET) C Save actual menu status in SAVDEM.MAV CALL MPRSAV('SAVDEM') C close all currently open files (e.g. CALL TFREND) C C Leave actual program and chain CALL CHAINF('FNCTIO.SAV',arg2,arg3) END SUBROUTINE ROUT06 (IRET) C Set-up new screen, get data, process etc. IRET=1 ! normal return RETURN END Compile the main programs and link MPRDEM with the application subroutines, the menu driver subroutines and with the compiled generated FORTRAN subroutine: MPREXE. The chaining process to routine ROUT05 can be solved differently under RSX. The main program MPRDEM.TSK will be now: Software example page 6-4 PROGRAM MPRDEM C C Carry out initialization activities C CALL MPRMEN('DEMO',2) CALL MPREND C END The subroutine ROUTE05: SUBROUTINE ROUT05(IRET) C CALL DCLCMD('RUN FUNCTIO.TSK','WAIT') RETURN END CHAPTER 7 System internals Information on the MPR package, as described in the previous chapters, might in most cases do for understanding and using the menu driver subroutines properly. For maintenance on the package and in special cases where linking in overlay is required, more information of the system internals might be useful. 7.1 System subroutines Besides the menu driver subroutines previously described, there are another seven subroutines in the package used by the menu driver subroutines: MPRCM - clears the message area after the acceptance of an operator response MPRDM - displays the current menu MPRGF - if the response buffer is empty: asks for operator response (one or more functions separated by comma's). if the response buffer is not empty: reads a function key (embedded in comma's) from the response buffer. MPRMN - handles menu processing within the current menu-tree. MPRPM - positions the menu library file for the current menu. MPRPP - 'pops' menu from the menu-stack. MPRPS - 'pushes' menu on the menu-stack. System internals page 7-2 7.2 System size The MPR subroutines use alltogether about 3 K words of memory plus .25 K words per I/O buffer used (=open logical unit number). Because MPRMEN and MPRMES aren't necessarely used both, this size can be reduced according to the specific application requirements. MPR uses a common area with the name MPRCOM and a size of 342 bytes (171 words) for the communication between the various menu system subroutines. 7.3 Overlay requirements All menu driver subroutines may overlay one another. The system subroutines MPRCM, MPRDM, MPRGF, MPRMN, MPRPM, MPRPP and MPRPS, may sometimes overlay each other. If the linkage editor does not automatically places the common area MPRCOM in the root of the overlay structure, a common area as described in the previous section must be declared in the root-segment of the program. Table 2 shows which subroutines issue calls for other MPR-, USERLIB- and/or SYSLIB-subroutines. System internals page 7-3 Table 2: Subroutine calls of the system subroutines: cal \ by| MPR MPR MPR MPR MPR MPR MPR MPR MPR MPR MPR MPR -led \ | END MEN MES RST SAV CM DM GF MN PM PS EXE --------+----------------------------------------------------- MPRCM | X X X MPRDM | X X MPRGF | X MPRMN | X X MPRPM | X MPRPP | X MPRPS | X | MPREXE | X | FATAL | X X X X GSUBS | X SCVTLU | X SWRITE | X X X X X X | GETSTR | X INDEX | X ISCOMP | X LEN | X X X X X SCOPY | X X X X X X | appli- | cation | X routines| INDEX Break-through, 4-4 2-3, 3-3, 6-2 header, 2-4, 3-3 Clear message, 7-1 library, 1-2, 2-2, 3-3, 5-1, Common area, 7-2 6-2 save-file, 5-2 to 5-3 Data item, 2-3 source file, 1-1 to 1-2, separator, 2-3 2-1 to 2-2, 6-1 Display status, 5-2 to 5-3 help message, 4-1 tree, 2-3, 3-3 help text, 4-4 Menu control, 5-1 information line, 4-1 functions, 4-3 menu, 4-2, 7-1 keys, 4-3 message, 5-1 Menu description, 1-2, 2-1 to 2-2, 4-1 to 4-2 Error, 3-5 language, 1-1 to 1-2, fatal, 3-5 2-1 to 2-3 message, 3-5, 5-2 record, 2-3 warning, 3-5 Menu driver subroutines, Exit function, 4-2 to 4-3 1-1 to 1-2, 2-1, 4-1 to 4-2 Message on menu, 5-2 File name extension, 3-2 to 3-3 Normal return, 3-4, 6-3 Function, 2-2 execution, 1-2 Overlay requirements, 7-1 to 7-2 key, 2-2 to 2-3, 2-5 to 2-6, 3-3, 4-1, 4-4 Record type code, 2-3 keyword, 1-2, 2-2, 4-2, 4-4 Return Function-list, 1-2, 2-2, 3-3 to main menu, 4-3 line, 2-5 to 2-6 to previous menu, 4-4 Return code, 3-4 General header, 2-4, 3-3 Generated subroutine, 3-4, Screen 6-1 to 6-3 lay-out, 2-3, 3-3 menu, 2-2 Help Size of the system, 7-2 function, 4-4 Special return, 3-4, 6-3 message, 4-1, 5-2 System header, 2-3 System subroutine, 7-1, 7-3 Information line, 4-1 Text editor, 1-2, 2-1 to 2-3, List-line, 2-5 to 2-6 6-1 Menu, 4-1 to 4-2 compiler, 1-1 to 1-2, 2-1, 3-1, 6-2 document list file, 1-2, 2-1,