GRSTATUS (W*32, W*64)

Graphics Function: Returns the status of the most recently used graphics routine.

Module: USE IFQWIN

Syntax

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
$GRIMPROPERBITMAPFORMAT Improper format for bitmap file
$GRFILEREADERROR Error reading file
$GRNOBITMAPFILE No bitmap file
$GRINVALIDIMAGEBUFFER Image buffer data inconsistent
$GRINSUFFICIENTMEMORY Not enough memory to allocate buffer or to complete a fill operation
$GRINVALIDPARAMETER One or more parameters invalid
$GRMODENOTSUPPORTED Requested video mode not supported
$GRERROR Graphics error
$GROK Success
$GRNOOUTPUT No action taken
$GRCLIPPED Output was clipped to viewport
$GRPARAMETERALTERED One or more input parameters was altered to be within range, or pairs of parameters were interchanged to be in the proper order

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
GETFILLMASK $GRERROR,
$GRINVALIDPARAMETER
GETFONTINFO $GRERROR
GETGTEXTEXTENT $GRERROR
GETIMAGE $GRINSUFFICIENTMEMORY $GRPARAMETERALTERED
GETPIXEL $GRBITMAPTOOLARGE
GETPIXELRGB $GRBITMAPTOOLARGE
LINETO, LINETO_W $GRNOOUTPUT,
$GRCLIPPED
LOADIMAGE $GRFILEOPENERROR,
$GRNOBITMAPFILE,
$GRALEREADERROR,
$GRIMPROPERBITMAPFORMAT,
$GRBITMAPTOOLARGE,
$GRIMAGEREADERROR
OUTGTEXT $GRNOOUTPUT,
$GRCLIPPED
PIE, PIE_W $GRINVALIDPARAMETER,
$GRINSUFFICIENTMEMORY
$GRNOOUTPUT
POLYGON, POLYGON_W $GRINVALIDPARAMETER,
$GRINSUFFICIENTMEMORY
$GRNOOUTPUT,
$GRCLIPPED
PUTIMAGE, PUTIMAGE_W $GRERROR,
$GRINVALIDPARAMETER,
$GRINVALIDIMAGEBUFFER
$GRBITMAPDISPLAYERROR
$GRPARAMETERALTERED,
$GRNOOUTPUT
RECTANGLE, RECTANGLE_W $GRINVALIDPARAMETER,
$GRINSUFFICIENTMEMORY
$GRNOOUTPUT,
$GRCLIPPED
REMAPPALETTERGB $GRERROR,
$GRINVALIDPARAMETER
REMAPALLPALETTERGB $GRERROR,
$GRINVALIDPARAMETER
SAVEIMAGE $GRFILEOPENERROR
SCROLLTEXTWINDOW $GRNOOUTPUT
SETBKCOLOR $GRINVALIDPARAMETER $GRPARAMETERALTERED
SETBKCOLORRGB $GRINVALIDPARAMETER $GRPARAMETERALTERED
SETCLIPRGN $GRPARAMETERALTERED
SETCOLOR $GRPARAMETERALTERED
SETCOLORRGB $GRPARAMETERALTERED
SETFONT $GRERROR,
$GRINSUFFICIENTMEMORY
$GRPARAMETERALTERED
SETPIXEL, SETPIXEL_W $GRNOOUTPUT
SETPIXELRGB,
SETPIXELRGB_W
$GRNOOUTPUT
SETTEXTCOLOR $GRPARAMETERALTERED
SETTEXTCOLORRGB $GRPARAMETERALTERED
SETTEXTPOSITION $GRPARAMETERALTERED
SETTEXTWINDOW $GRPARAMETERALTERED
SETVIEWPORT $GRPARAMETERALTERED
SETWINDOW $GRINVALIDPARAMETER $GRPARAMETERALTERED
SETWRITEMODE $GRINVALIDPARAMETER

Compatibility

STANDARD GRAPHICS QUICKWIN GRAPHICS LIB

See Also

ARC, ELLIPSE, FLOODFILLRGB, LINETO, PIE, POLYGON, REMAPALLPALETTERGB, SETBKCOLORRGB, SETCOLORRGB, SETPIXELRGB, SETTEXTCOLORRGB, SETWINDOW, SETWRITEMODE, Building Applications: Setting the Font and Displaying Text