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>open_error(name, line, info, model, _1) open error</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Open_error(name, line, info, model, _1)           Open error

   Open errors occur when a file open operation fails.  This includes
   all Clipper file operations other than those using the low-level file
   I/O functions.


Info messages: Open error

Model:         The "model" in this case contains a fragment of code
               indicating the operation taking place when the error
               occurred.  The operand parameter, "_1" contains the name
               of the file that instigated the error.

Recovery:      RETURN (.T.) to retry the open operation.
               RETURN (.F.) to skip the current operation and continue
               execution.  This normally has no ill effect, except that
               the file in question is not in USE as expected.  Note
               that execution may continue within the current source
               code line if the line contains several file open
               operations (i.e. SET INDEX).


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

   FUNCTION open_error
   PARAM name, line, info, model, _1

   IF NETERR() .AND. model == "USE"
      RETURN .F.
   END

   SET DEVICE TO SCREEN
   @ 0, 0
   @ 0, 0 SAY "Proc " + M->name + " line " + LTRIM(STR(M->line)) +;
            ", " + M->info + " " + M->_1 + " (" + LTRIM(STR(DOSERROR())) + ")"
   @ 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 open_error
   PARAM name, line, info, model, _1

   ALTD(2)

   SET DEVICE TO SCREEN
   @ 0, 0
   @ 0, 0 SAY "Proc " + M->name + " line " + LTRIM(STR(M->line)) + ", "  +;
            M->info + ": " + M->model + " " + M->_1
   @ 1, 0 SAY "Press Esc to abort, any other key to retry..."
   @ 2, 0 SAY SELECT()

   IF (INKEY(0) == 27)
      @ 0,0
      @ 1,0
      RETURN .F.
   END

   @ 0,0
   @ 1,0

   RETURN .T.


See Also: DOS Errors

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