Priority queue: Difference between revisions

imported>Pjfarley3
imported>Pjfarley3
Line 2,272:
 
In the "two pass merge" subroutine (PTYQ2PMG), the final three lines are needed because without using "user defined functions" the arguments to the outer call to the "merge" subroutine must be executed first, and the results of those two calls become the arguments to the final "merge" call.
 
Note also that the subroutines call each other using "PIC X(8)" pseudonym's because using the actually recursive subroutines cannot ust the "same name" as both the PROGRAM-ID and as a variable name. This could be resolved by simply using "constant" calls (like ```CALL "PTYQ2PMG" using . . . ``` but using the pseudonym's allows each of the subroutines to also be separately compiled into an executable module and then dynamically loaded at run time. Many IBM shops will prefer that method to this purely "static" solution.
 
<syntaxhighlight lang="COBOL">
Anonymous user