IBM Version 4 Universal Remote User Manual


 
ᑍ Remove an exit program from the exit point and then deregister
ᑍ the exit point. It is not necessary to remove exit programs
ᑍ from an exit point before deregistering the exit point. It is
ᑍ done here only for illustrative purposes.
ᑍ Initialize the error code parameter. To signal exceptions to
ᑍ this program by the API, you need to set the bytes provided
ᑍ field of the error code to zero. Because this program has
ᑍ exceptions sent back through the error code parameter, it sets
ᑍ the bytes provided field to the number of bytes it gives the
ᑍ API for the parameter.
MOVE 16 TO BYTES-PROVIDED OF QUS-EC.
ᑍ Call the API to remove the exit program.
CALL PROCEDURE "QusRemoveExitProgram" USING
EXIT-POINT-NAME, FORMAT-NAME,
PGM-NBR, QUS-EC.
ᑍ If an exception occurs, the API returns the exception in the
ᑍ error code parameter. The bytes available field is set to
ᑍ zero if no exception occurs and greater than zero if an
ᑍ exception does occur.
IF BYTES-AVAILABLE OF QUS-EC > 
OPEN OUTPUT LISTING,
MOVE EXCEPTION-ID OF QUS-EC
TO EXCEPTION-ID OF BAD-EXIT-POINT,
WRITE LIST-LINE FROM BAD-EXIT-POINT,
STOP RUN.
ᑍ If the call to remove the exit program is successful,
ᑍ deregister the exit point.
ᑍ Call the API to deregister the exit point.
CALL PROCEDURE "QusDeregisterExitPoint" USING
EXIT-POINT-NAME, FORMAT-NAME, QUS-EC.
ᑍ If an exception occurs, the API returns the exception in the
ᑍ error code parameter. The bytes available field is set to
ᑍ zero if no exception occurs and greater than zero if an
ᑍ exception does occur.
IF BYTES-AVAILABLE OF QUS-EC > 
OPEN OUTPUT LISTING,
MOVE EXCEPTION-ID OF QUS-EC
TO EXCEPTION-ID OF BAD-EXIT-PGM,
WRITE LIST-LINE FROM BAD-EXIT-PGM,
STOP RUN.
STOP RUN.
ᑍ End of MAINLINE
Appendix B. Original Examples in Additional Languages B-89