6 GKS Error Handler

The error handling routine that is used by default reports errors via the Starlink Error Reporting System (SUN/104) and the error channel parameter passed to GOPWK is ignored.

Using the ERR package for error reporting not only makes GKS’s error reporting the same as other Starlink subroutine libraries, but also allows programs to detect that GKS has reported an error without having to supply their own error reporting routine. The following example show how this is done:

        INTEGER LASTER
  
  *   Include GKS error codes
        INCLUDE ’GKS_ERR’
  
  *   Call GKS routines....
  ....
  
  *   Call err to see if an error has been reported
        CALL ERR_STAT(LASTER)
  
  *   See if it was a GKS error
        IF ( LASTER .EQ. GKS__ERRROR ) THEN
  
  *      Yes...
  ...
  
        ELSE
  
  *      No...
  ...
        END IF
  ...