Borland C++ reference

grapherrormsg

raw OCR

Returns a pointer to an error message string.

Defined in header <graphics.h>

Syntax

#include <graphics.h>
char * far grapherrormsg(int errorcode);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

grapherrormsg returns a pointer to the error message string associated with errorcode, the value returned by graphresult.

Refer to the entry for err no in Chapter 3 ("Global variables") for a list of error messages and mnemonics.

Return value

grapherrormsg returns a pointer to an error message string.

See also

Example

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

#define NONSENSE -50

int main(void)
{
   /* force an error to occur */
   int gdriver = NONSENSE, gmode, errorcode;

   /* initialize graphics mode  7
   initgraph(&gdriver, &gmode,

   /* read result of initialization */
   errorcode = graphresult ();

   /* if an error occurred, then output descriptive error message  */
   if (errorcode != grOk) {
      printf("Graphics error: %s\n", grapherrormsg (errorcode));
      printf("Press any key to,halt:"),•
      getchO ;
      exit(l);               /* terminate with an error code  */

   /* draw a line */
   line(0, 0, getmaxxO,  getmaxyl

   /* clean up */
   getchO;
   closegraphO ;
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.