Java Reference
In-Depth Information
PERFORM CALL-MYSUB WITH TEST AFTER UNTIL
NOT MYSUB-OUT-FUNCTION-EXTENDED.
DISPLAY "MSG SIZE ", MSG-SIZE,
" MSG-TEXT ", MSG-TEXT,
" MSG TEXT changed ", TEXT-CHANGED-COUNTER,
" times.".
* Call MYSUB again without changing the TEXT-STRING.
PERFORM CALL-MYSUB WITH TEST AFTER UNTIL
NOT MYSUB-OUT-FUNCTION-EXTENDED.
* Notice that the changed counter did not increment, but the call
* counter in MYSUB did.
MOVE "G" TO MYSUB-ACTION-SWITCH.
MOVE " " TO MYSUB-ACTION-EXTENDED-SWITCH.
PERFORM CALL-MYSUB.
DISPLAY "MSG SIZE ", MSG-SIZE,
" MSG-TEXT ", MSG-TEXT,
" MYSUB COUNTER ", MYSUB-RETURNED-CALL-COUNTER,
" MSG TEXT changed ", TEXT-CHANGED-COUNTER,
" times.".
EXIT-PROGRAM.
EXIT PROGRAM.
STOP RUN.
CALL-MYSUB SECTION.
CALL-MYSUB-S.
CALL "MYSUB" USING MYSUB-CONTROL, TEXT-STRING.
* If MYSUB returns before completion, perform some extended
* functions.
IF MYSUB-OUT-FUNCTION-EXTENDED
PERFORM EXTENSIONS-TO-MYSUB.
EXTENSIONS-TO-MYSUB SECTION.
EXTENSIONS-TO-MYSUB-S.
* Count the number of times MYSUB changes MSG-TEXT.
*
If MYSUB is about to change MSG-TEXT, increment a counter.
IF MSG-TEXT NOT = TEXT-STRING
ADD 1 TO TEXT-CHANGED-COUNTER.
Search WWH ::




Custom Search