Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>print_error(name, line, info) print error</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Print_error(name, line, info)                     Print Error

   Print errors occur whenever the parallel printer is not ready.  If
   the printer is redirected to a serial port and the port is not ready,
   Open_error() is invoked instead.


Info messages: Printer error

Recovery:      RETURN (.T.) retries the printer access operation.
               RETURNing false (.F.) skips the printer access operation
               and continues execution.  The latter is not recommended
               since you may not know what operation will execute next.


------------------------- Example -- Errorsys.prg ----------------------------

   FUNCTION print_error
   PARAM name, line

   SET DEVICE TO SCREEN
   @ 0, 0
   @ 0, 0 SAY "Proc " + M->name + " line " + LTRIM(STR(M->line)) +;
            ", printer not ready"

   @ 0, 65 SAY "Retry? (Y/N)"

   INKEY(0)

   DO WHILE .NOT. CHR(LASTKEY()) $ "YyNn"
      INKEY(0)
   END

   IF .NOT. CHR(LASTKEY()) $ "Yy"
      QUIT
   END

   @ 0,0

   RETURN .T.


------------------------- Example -- Alterror.prg -----------------------------

   FUNCTION print_error
   PARAM name, line
   PRIVATE key, file

   SET DEVICE TO SCREEN
   @ 0, 0
   @ 0, 0 SAY "Proc " + M->name + " line " + LTRIM(STR(M->line)) +;
            ", printer not ready"
   @ 1, 0 SAY "Press <I>gnore, <R>etry, <B>REAK, F<ile>, <Q>uit..."

   DO WHILE .T.
      key = UPPER(CHR(INKEY(0)))

      IF (M->key == "Q")
         QUIT

      ELSEIF (M->key == "I")
         @ 0,0
         @ 1,0
         RETURN .F.

      ELSEIF (M->key == "R")
         @ 0,0
         @ 1,0
         RETURN .T.

      ELSEIF (M->key == "B")
           set device to SCREEN
         @ 0,0
         @ 1,0
         BREAK

      ELSEIF (M->key == "F")
         @ 0, 0
         @ 1,0
         ACCEPT "Filename - " TO file
         SET PRINTER TO (M->file)
         @ 0,0
         @ 1,0
         RETURN .T.

      END
   END

   RETURN .F.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson