The _merge utility merges common subroutines into the workspace. It prompts for a library file name, which is a PRO/5 program file from which subroutines can be recalled. After the library file name has been entered, the library file is cataloged (all the subroutines and their offsets are found within the file). The _merge utility will display a list of subroutines from which to select those to merge into the workspace.
The selection process allows the user to move the cursor to any item in the list and press S for select, D for deselect, C to deselect all items, or E to exit. When an item is selected, the utility searches the selected subroutine in the library for references it may have to other subroutines. If references are found, those subroutines are automatically selected. Furthermore, each additional subroutine selected is also searched. The process continues until there are no longer deselected, referenced subroutines. Selection is made using the standard edit keys (on terminals is so equipped) or by using ^J (down), ^K (up), ^L(right), or ^H(left).
Program File Format
The library file is a PRO/5 program file with special REM verbs that identify where a subroutine begins and a previous subroutine ends. These REM statements are referred to as signatures, with the following format:
9000 REM 0 - [end_util]
This signature indicates that at line 9000 the subroutine end_util begins. end_util continues until either the next signature in the file is encountered or the end of the program file is found. The subroutine name can have up to 24 characters (any printable character is legal), and up to 60 subroutines per program file (library) can be defined.
While merging a subroutine into a workspace, the signature of the merged subroutine is modified. The modified format of the merged subroutine is similar to:
9000 REM 0 - (end_util) 9000-9040
This signature indicates that at lines 9000 through 9040 a common subroutine called end_util can be found. Later, if this subroutine changes in the library, the utility _update can be used to update those program files that reference this subroutine. The _update utility will recognize this modified signature format and remove those lines of the user program file before placing the newer version of the subroutine into the program. While merging the subroutine into the workspace, all REM statements are removed. This conserves program space, while allowing virtually unlimited REM verbs in the master library version. In-house programmers are encouraged to consult the master library version for additional information about how each subroutine works.