Condition Codes [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
Condition Codes
Frequently, condition codes are returned to a FORTRAN 77 program by
system intrinsics. These condition codes are listed in table 8-2.
Specific meanings depend on individual intrinsics; refer to the MPE/iX
Intrinsics Reference Manual for condition codes of specific intrinsics.
Table 8-2. Condition Codes
---------------------------------------------------------------------
| | |
| Condition Code | Meaning |
| | |
---------------------------------------------------------------------
| | |
| CCE | Condition code is zero. This generally |
| | indicates that the request was granted. |
| | |
---------------------------------------------------------------------
| | |
| CCG | Condition code is greater than zero. A special |
| | condition occurred but it might not have |
| | affected the execution of the request. (For |
| | example, the request was executed, but the |
| | default values were assumed as intrinsic call |
| | parameters.) |
| | |
---------------------------------------------------------------------
| | |
| CCL | Condition code is less than zero. The request |
| | was not granted, but the error condition might |
| | be recoverable. |
| | |
---------------------------------------------------------------------
Beside condition codes, some intrinsics return additional error
information to the calling program through their return values.
The condition code can be checked with the CCODE( ) function. CCODE
returns an integer value indicating the condition code resulting from a
call to a system intrinsic.
It is good practice to check the condition code using an arithmetic IF
statement immediately following the intrinsic call, as shown in the
following example. Similarly, the CCODE function must not appear in the
INTRINSIC statement that is to be passed as an actual parameter to a
subroutine that expects a procedure parameter because the condition code
would be lost.
The following program checks the condition code after calling a system
intrinsic.
PROGRAM printop2
C
C EXAMPLE PROGRAM TO CALL SYSTEM INTRINSIC PRINTOP
C
CHARACTER message*14
LOGICAL lmessage (7)
SYSTEM INTRINSIC printop
EQUIVALENCE (lmessage, message)
message='This is a test'
CALL printop (lmessage, -14, 0)
IF (CCODE()) 20, 10, 20
10 STOP 'Successful Write'
20 STOP 'Intrinsic returned bad condition code'
END
MPE/iX 5.0 Documentation