20.4.5 Condition Values
Many system routines return a condition value that indicates
success or failure. If a condition value is returned, you should
check this value after you call a system routine and control
returns to your program.
Condition values indicating success always appear first in the
list of condition values for a particular routine, and success
codes always have odd values. A success code that is com-
mon to many system routines is the condition value SS$_
NORMAL, which indicates that the routine completed nor-
mally and successfully. You can test for this condition value
as follows:
ret_status = SMG$CREATE_PASTEBOARD(pb_id)
IF (ret_status <> SS$_NORMAL) THEN
CALL LIB$STOP(ret_status BY VALUE)
END IF
Because all success codes have odd values, you can check a
return status for any success code. For example, you can
cause execution to continue only if a success code is returned
by including the following statements in your program:
ret_status = SMG$CREATE_PASTEBOARD(pb_id)
IF (ret_status AND 1%) = 0% THEN
CALL LIB$STOP(ret_status BY VALUE)
END IF
In general, you can check for a particular success or failure
code or you can test the condition value returned against all
success codes or all failure codes.