Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

GRSTATUS

Graphics Function: Returns the status of the most recently used graphics routine. This routine is only available for Windows.

Module

USE IFQWIN

result = GRSTATUS( )

Results

The result type is INTEGER(2). The result is the status of the most recently used graphics function.

Use GRSTATUS immediately following a call to a graphics routine to determine if errors or warnings were generated. Return values less than 0 are errors, and values greater than 0 are warnings.

The following symbolic constants are defined in the IFQWIN.F90 module file for use with GRSTATUS:

Constant

Meaning

$GRFILEWRITEERROR

Error writing bitmap file

$GRFILEOPENERROR

Error opening bitmap file

$GRIMAGEREADERROR

Error reading image

$GRBITMAPDISPLAYERROR

Error displaying bitmap

$GRBITMAPTOOLARGE

Bitmap too large

After a graphics call, compare the return value of GRSTATUS to $GROK. to determine if an error has occurred. For example:

  IF ( GRSTATUS .LT. $GROK ) THEN
  ! Code to handle graphics error goes here
  ENDIF

The following routines cannot give errors, and they all set GRSTATUS to $GROK:

DISPLAYCURSOR

GETCOLORRGB

GETTEXTWINDOW

GETBKCOLOR

GETTEXTCOLOR

OUTTEXT

GETBKCOLORRGB

GETTEXTCOLORRGB

WRAPON

GETCOLOR

GETTEXTPOSITION

 

The following table lists some other routines with the error or warning messages they produce for GRSTATUS:

Function

Possible GRSTATUS error codes

Possible GRSTATUS warning codes

ARC, ARC_W

$GRINVALIDPARAMETER

$GRNOOUTPUT

CLEARSCREEN

$GRINVALIDPARAMETER

 

ELLIPSE, ELLIPSE_W

$GRINVALIDPARAMETER, $GRINSUFFICIENTMEMORY

$GRNOOUTPUT

FLOODFILLRGB

$GRINVALIDPARAMETER, $GRINSUFFICIENTMEMORY

$GRNOOUTPUT

GETARCINFO

$GRERROR