home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / DATABASE / PROERROR.ZIP / PROERROR.PRG < prev   
Encoding:
Text File  |  1991-05-17  |  62.6 KB  |  1,954 lines

  1.  
  2. *:*********************************************************************
  3. *:
  4. *:
  5. *:         System: FOXPRO 1.x ERROR HANDLING SYSTEM
  6. *:         Author: Pat Adams, DB Unlimited (718) 469-4032
  7. *:      Copyright (c) 1989, 1990, 1991 DB Unlimited
  8. *:  Last modified: 5/17/91
  9. *   Revision Number 5.13
  10. *
  11. *    All Rights Reserved - PROERROR may be used in your own
  12. *   applications and modified for use in your applications
  13. *   with no fees, licenses or other approvals required.
  14. *   It may *not* be used in articles, books, talks or other
  15. *   presentations without specific prior approval nor may 
  16. *   PROERROR or modifications thereof be sold or otherwise
  17. *   issued for monetary gain.
  18. *
  19. *   Special thanks to Y. Alan Griver, Mike Fahey, Jeri
  20. *   Rosenhaft, Guy Scharf, John Hoffman, Leo Tohill and others  
  21. *   too numerous to mention here for their help in alpha and beta
  22. *   as well as design suggestions.
  23. *:
  24. *:  Procs & Fncts: PROERROR
  25. *:               : NOFILE
  26. *:               : PROFATAL
  27. *:               : RAZBERRY
  28. *:               : A_LERT
  29. *:               : FILEBUSY
  30. *:               : REC_BUSY
  31. *:               : INDEX_ER
  32. *:               : READONLY
  33. *:               : NOACCESS
  34. *:               : NOCREATE
  35. *:               : NO_OPEN
  36. *:               : REALBAD1
  37. *:               : TRASHED
  38. *:               : KORRUPT
  39. *:               : READ_ERR
  40. *:               : RITE_ERR
  41. *:               : MIXUP
  42. *:               : INVALPRN
  43. *:               : BADCHAIN
  44. *:               : NOSPACE
  45. *:               : NOTREADY
  46. *:               : LOWFILES
  47. *:               : WORKSPAC
  48. *:               : YES_NO
  49. *:
  50. *:           Uses: PROERROR.DBF   
  51. *:
  52. *:*********************************************************************
  53. *& Save error information to database or retry
  54. *
  55. *   NOTE: This routine is specific to FoxPro.
  56. *
  57. *   Information is stored to the PROERROR.DBF file and then
  58. *   the user is returned to master calling program if a RETRY
  59. *   is not issued.  Please note that PROERROR closes all files
  60. *   and indexes before issuing a RETURN TO MASTER.  It is expected
  61. *   that the MASTER level file will initialize all necessary global
  62. *   memvars, open databases and indexes, etc. as required for a
  63. *   particular system.
  64. *
  65. *   Utilize the following command to set up this system to
  66. *   respond to FoxPro errors:
  67. *
  68. *   ON ERROR DO PROERROR WITH ERROR(), MESSAGE(), MESSAGE(1), ;
  69. *      SYS(16), LINENO(), SYS(102), SYS(100), SYS(101), LASTKEY(), ;
  70. *       DBF(), SYS(18)
  71. *
  72. *  Parameters are:
  73. *
  74. *        xerno =  The numeric code of the number provided by ERROR()
  75. *        xmsg =   The error message provided by MESSAGE()
  76. *        xkode =  The contents of the line of code which
  77. *                    triggered the error as provided by MESSAGE(1)
  78. *        xmodul = The name of the code module, SYS(16)
  79. *        xline =  The number of the line of code triggering the
  80. *                  error, LINENO()
  81. *        xprint = Current PRINTER setting as per SYS(102)
  82. *        xkonsol= Current CONSOLE setting as per SYS(100)
  83. *        xdevice= Current DEVICE setting as per SYS(101)
  84. *        keypress = LASTKEY()
  85. *        curr_dbf = Selected .DBF when error occurred
  86. *        getfield = Field of GET...READ at time error occurred
  87. *
  88. *  In addition to this data, the routine saves the information from
  89. *   DISPLAY MEMORY and DISPLAY STATUS is saved to the memo field.
  90. *
  91. *  Note that if the .PRG file for a system is not available or the COMPILE 
  92. *  NODEBUG command has been utilized the contents of the line of code and the
  93. *  line number of the line of code which triggered the error will not
  94. *  be available.
  95. *
  96. *  The INKEY(0, "M") permits user to click the left mouse key
  97. *  in response to the "Press any key..." message.
  98. *
  99. *  In release 5.11 the structure of the PROERROR.DBF file has
  100. *  been modified slightly.  The field previously named MODUL
  101. *  has been changed to MMODUL.  This avoid expansion of "modul"
  102. *  by FoxDoc, SNAP! and other similar utilities used to parse
  103. *  the source code.
  104. *
  105. *  Release 5.12 introduced the YES_NO module to get user input,
  106. *  and temporary disables the ON ERROR DO PROERROR WITH...
  107. *  to avoid any recursive ON ERROR calls to PROERROR.  The ON
  108. *  ERROR DO PROERROR WITH...  is reinitalized before leaving the
  109. *  PROERROR routine.
  110. *
  111. *  Version 5.12 also makes some changes to the 1705 error message.
  112. *  It has been found that InvisibleNet erroneously returns error
  113. *  1705 when a file is in EXCLUSIVE use by another instead of the
  114. *  expected error #3.  (Novell correctly returns error #3)  The
  115. *  module called for the 1705 error now checks for this.
  116. *
  117. *  Version 5.13 adds a specific check for error #91, "Module not
  118. *  loaded" which occurs when attempting to RELEASE MODULE which
  119. *  is not loaded.  A specific trap for error #104, "Unknown Function Key"
  120. *  has also been added so the error is simply ignored.
  121. *  Version 5.13 also adds a memory variable, GETFIELD, to provide
  122. *  information on the field currently being read, if applicable.
  123. *!*********************************************************************
  124. PROCEDURE proerror
  125. ***********************************************************************
  126. *
  127. *& Controlling module for the FoxPro error handling system.
  128. *
  129. *  Author: Pat Adams, DB Unlimited    (718) 469-4032
  130. *     Copyright 1989, 1990, 1991 DB Unlimited
  131. *     All rights reserved
  132. *
  133. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  134. PARA xerno, xmsg, xkode, xmodul, xline, xprint, ;
  135.     xkonsol, xdevice, keypress, curr_dbf, getfield
  136. STORE .F. TO tryagain
  137. ON ERROR ?? CHR(7)
  138.  
  139. IF xerno = 91 .OR. xerno = 168 .OR. xerno = 104 .OR. xerno = 214 
  140.     * =======================================================
  141.     *$ This is a temporary work-around because some editions
  142.     *  of FoxPro return error # 168 (MENU has not been defined)
  143.     *  or error # 214 (WINDOW has not been defined) when attempting
  144.     *  to do housekeeping by RELEASE MENU/WINDOW which is not
  145.     *  currently defined.  Fox has promised a fix for this at
  146.     *  a later date.
  147.     *
  148.     *  Error #91, "Module was not loaded" is returned when
  149.     *  an attempt is made to RELEASE MODULE which has already
  150.     *  been released or was not loaded.
  151.     *
  152.     *  Error #104 occurs when a call to function keys F11 or F12
  153.     *  are made and an older keyboard without these keys is in use.
  154.     * =======================================================
  155.     SET CONSOLE &xkonsol
  156.     SET DEVICE TO &xdevice
  157.     ON ERROR DO PROERROR WITH ERROR(), MESSAGE(), MESSAGE(1), ;
  158.         SYS(16), LINENO(), SYS(102), SYS(100), SYS(101), LASTKEY(), ;
  159.         DBF(), SYS(18)
  160.     RETURN
  161. ENDIF xerno = 168
  162.  
  163. DO CASE xerno
  164. CASE xerno = 1
  165.     * ========================
  166.     *$ File does not exist
  167.     *  Pop up window to warn user.
  168.     * ========================
  169.     ON KEY       && Null out all hot keys
  170.     DO nofile WITH xerno, xmsg, xkode, xmodul, xline
  171.     * ======================
  172.     * Return to the master level
  173.     * ======================
  174.     ON ERROR DO PROERROR WITH ERROR(), MESSAGE(), MESSAGE(1), ;
  175.         SYS(16), LINENO(), SYS(102), SYS(100), SYS(101), LASTKEY(), ;
  176.         DBF(), SYS(18)
  177.     RETURN TO MASTER
  178.     
  179. CASE xerno =  3 .OR. xerno = 108 
  180.     * =================================
  181.     *$ File is in use by another.
  182.     *  Advise user & provide option to retry
  183.     * =================================
  184.     DO filebusy WITH tryagain
  185.     
  186. CASE xerno = 109
  187.     * ========================
  188.     *$ Record in use by another.
  189.     *  Advise user & provide option to retry
  190.     * ========================
  191.     DO rec_busy WITH tryagain
  192.     
  193. CASE xerno = 4
  194.     * ====================================
  195.     *$ End of file encountered.  With the
  196.     *  ON ERROR statement active this error
  197.     *  message may be encountered when using
  198.     *  code such as DO WHILE .NOT. EOF(), so
  199.     *  simply return to next line in calling program
  200.     * ====================================
  201.     SET PRINT &xprint
  202.     SET CONSOLE &xkonsol
  203.     SET DEVICE TO &xdevice
  204.     ON ERROR DO PROERROR WITH ERROR(), MESSAGE(), MESSAGE(1), ;
  205.         SYS(16), LINENO(), SYS(102), SYS(100), SYS(101), LASTKEY(), ;
  206.         DBF(), SYS(18)
  207.     RETURN
  208.     
  209. CASE xerno = 38
  210.     * ==========================
  211.     *$ Attempt has been made to position record
  212.     *  pointer before the first record in the file.
  213.     *  Correct by going to top of file, skipping down
  214.     *  one record, then retrying the same command line.
  215.     * ==========================
  216.     GO TOP
  217.     SKIP
  218.     STORE .T. TO tryagain
  219.  
  220. CASE xerno = 5 .OR. xerno = 20 .OR. xerno = ;
  221.         26 .OR. xerno = 114
  222.     * ==============================================
  223.     *$ Record is out of range error message
  224.     *  or Record is not in index error message.
  225.     *  This usually means an index has been corrupted
  226.     *  or the data or database was changed without the
  227.     *  index active.
  228.     *
  229.     *  Also handles the index damaged error message
  230.     *  and Index does not match database error message.
  231.     *  Pop up message to user and then quit to main menu.
  232.     * ============================================
  233.     DO index_er
  234.     STORE .F. TO tryagain
  235.     
  236. CASE xerno = 111
  237.     * ============================
  238.     *$ Cannot write to a read-only file.
  239.     *  Attempt has been made to use a file
  240.     *  created for read only purposes.
  241.     * ============================
  242.     DO readonly
  243.     STORE .F. TO tryagain
  244.     
  245. CASE xerno = 1101
  246.     * ====================
  247.     *$ Cannot open file
  248.     * ====================
  249.     DO no_open
  250.     STORE .F. TO tryagain
  251.     
  252. CASE xerno = 1705
  253.     * ==============================
  254.     *$ File access denied
  255.     * ==============================
  256.     DO noaccess WITH tryagain, xkode
  257.  
  258.     
  259. CASE xerno = 1102
  260.     * =======================
  261.     *$ Can not create file
  262.     * =======================
  263.     DO nocreate
  264.     STORE .F. TO tryagain
  265.     
  266. CASE xerno = 1157
  267.     * ===============================
  268.     *$ Cannot update file
  269.     *
  270.     *  This is really bad news - A hardware
  271.     *  error has resulted in the inability
  272.     *  to write to the disk.
  273.     * ===============================
  274.     DO realbad1
  275.     SET CURSOR ON
  276.     * ===================================
  277.     * Note that there is no attempt here
  278.     * to store information to the PROERROR.DBF
  279.     * file.  It is assumed such an attempt
  280.     * would result in the same error.
  281.     * ===================================
  282.     QUIT
  283.     
  284. CASE xerno = 1115 .OR. xerno = 15
  285.     * =======================================
  286.     *$ Worst case - Database has been trashed
  287.     * =======================================
  288.     DO trashed
  289.     STORE .F. TO tryagain
  290.     
  291. CASE xerno =  67 .OR. xerno = 1309
  292.     * =======================================
  293.     *$ Expression evaluator fault.  The .FRX
  294.     *  or other compiled files may be corrupted.
  295.     * =======================================
  296.     DO korrupt
  297.     STORE .F. TO tryagain
  298.     
  299. CASE xerno = 1104
  300.     * ===================================
  301.     *$ File read error
  302.     * Advise user and provide option to try again
  303.     * ===================================
  304.     DO read_err WITH tryagain
  305.     
  306. CASE xerno = 1105
  307.     * ========================================
  308.     *$ File write error
  309.     *  Advise user & provide option to try again
  310.     * ========================================
  311.     DO rite_err WITH tryagain
  312.     
  313. CASE xerno = 19
  314.     * ====================================
  315.     *$ Index file does not match database.
  316.     *  Index expression includes fields not
  317.     *  contained in the database file.
  318.     *  Advise user & return to Main Menu.
  319.     * ====================================
  320.     DO mixup
  321.     STORE .F. TO tryagain
  322.     
  323. CASE xerno = 124
  324.     * =========================
  325.     *$ Invalid printer redirection
  326.     *  which can only be fixed from DOS.
  327.     *  This normally occurs when attempts
  328.     *  are made to share a nonsharable
  329.     *  printer or the path to the print
  330.     *  device has not been properly defined.
  331.     *  Advise user & quit to DOS
  332.     * =========================
  333.     DO invalprn
  334.     
  335. CASE xerno = 1012
  336.     * ================================
  337.     *$ DOS free memory chain has been scrambled.
  338.     *  The only solution is to return to DOS.
  339.     * ================================
  340.     DO badchain
  341.     
  342. CASE xerno = 56
  343.     * =================================
  344.     *$ Out of disk error.  Return to DOS
  345.     * =================================
  346.     DO nospace
  347.     
  348. CASE xerno = 125
  349.     * ================================
  350.     * Printer not ready.
  351.     * Provide user with option to retry.
  352.     * =================================
  353.     DO notready WITH tryagain
  354.     
  355. CASE xerno = 6
  356.     * ================================
  357.     *$ Too many files open
  358.     *  The CONFIG.SYS needs to be changed.
  359.     *  Advise user & quit to DOS.
  360.     * ================================
  361.     DO lowfiles WITH xerno, xmsg, xkode, xmodul, xline
  362.     
  363. CASE xerno = 1410
  364.     * ====================================
  365.     *$ Unable to create temporary work files
  366.     *  Advise user & quit to DOS
  367.     * ====================================
  368.     DO workspac
  369.     
  370.   CASE xerno = 1642
  371.     * =====================================
  372.     *$ Colorset resource not found
  373.     *
  374.     *  This is NOT a recoverable error in the sense of
  375.     *  retrying the command since the named color set is 
  376.     *  missing.  However, FoxPro will use the default 
  377.     *  color set.
  378.     *
  379.     *  If the color set resource makes a
  380.     *  significant difference to the system this
  381.     *  CASE is appropriate.  The system will abort 
  382.     *  and info will be saved to the PROERROR database.
  383.     *  If, on the other hand, your application will
  384.     *  function without the named color set, astrisk
  385.     *  out this module as has been done here or simply
  386.     *  remove it.
  387.     * =====================================
  388.         STORE .F. TO tryagain
  389.         
  390. OTHERWISE 
  391. * ===============================================
  392. *$ Otherwise store information to database and
  393. *  return to Main Menu directly from Profatal
  394. * ================================================
  395.     DO profatal WITH xerno, xmsg, xkode, ;
  396.         xmodul, xline, xprint, xkonsol, xdevice, keypress
  397. ENDCASE xerno
  398.  
  399. IF tryagain
  400.     * ==============================
  401.     *& User has elected to try again
  402.     *  Restore environment & retry
  403.     * ==============================
  404.     SET PRINT &xprint
  405.     SET CONSOLE &xkonsol
  406.     SET DEVICE TO &xdevice
  407.     ON ERROR DO PROERROR WITH ERROR(), MESSAGE(), MESSAGE(1), ;
  408.         SYS(16), LINENO(), SYS(102), SYS(100), SYS(101), LASTKEY(), ;
  409.         DBF(), SYS(18)
  410.     RETRY
  411. ELSE
  412.     * ==========================
  413.     *$ Store info to error file
  414.     * ==========================
  415.     SET CONSOLE OFF
  416.     SELECT 0
  417.     USE proerror
  418.     * =======================================
  419.     * Error file is opened for use while other
  420.     * previously opened files are kept open so the
  421.     * information on what databases and indexes were
  422.     * open at the time of the error can be stored in
  423.     * the record for reference purposes.
  424.     * ========================================
  425.     APPEND BLANK
  426.     REPLACE er_no WITH xerno, er_msg WITH xmsg, ;
  427.         kode WITH xkode, mmodul WITH xmodul, ddate ;
  428.         WITH DATE(), ttime WITH TIME(), line_no WITH xline
  429.     SET SAFETY OFF
  430.     STORE SYS(3) + ".TXT" TO ffile
  431.     * ======================================
  432.     * Note use of indirect referencing instead
  433.     * of the ¯o substitution
  434.     * ======================================
  435.     LIST MEMO TO (ffile)
  436.     APPEND MEMO notes FROM (ffile)
  437.     LIST STATUS TO (ffile)
  438.     APPEND MEMO notes FROM (ffile)
  439.     ERASE (ffile)
  440.     ON KEY         && Clear out ON KEY LABELs
  441.     CLOSE DATA
  442.     UNLOCK ALL
  443.     CLEAR ALL    
  444.     ON ERROR DO PROERROR WITH ERROR(), MESSAGE(), MESSAGE(1), ;
  445.         SYS(16), LINENO(), SYS(102), SYS(100), SYS(101), LASTKEY(), ;
  446.         DBF(), SYS(18)
  447.     RETURN TO MASTER
  448. ENDIF tryagain
  449. * END Procedure Proerror
  450.  
  451.  
  452. *!*********************************************************************
  453. *!
  454. *!      Procedure: NOFILE
  455. *!
  456. *!      Called by: PROERROR.PRG                  
  457. *!
  458. *!          Calls: A_LERT         (procedure in PROERROR.PRG)
  459. *!
  460. *!           Uses: PROERROR.DBF   
  461. *!
  462. *!*********************************************************************
  463. PROCEDURE nofile
  464. ***********************************************************************
  465. *& File does not exist error has been encountered.
  466. *  Pop up window to warn user and tell user to call
  467. *  immediately.  Store information to database.
  468. * * * * * * * * * * * * * * * * * * * *
  469. PARAMETERS xerno, xmsg, xkode, xmodul, xline
  470. DEFINE WINDOW bugbox FROM 6,22 TO 16,57 PANEL SHADOW ;
  471.    COLOR W+/N,N/W,R+*/R
  472. ACTIVATE WINDOW bugbox
  473. SET ESCAPE OFF
  474. SET CURSOR OFF
  475. @ 1, 3 SAY "The file you need is missing!"
  476. @ 3, 4 SAY "Please call Pat Adams at"
  477. @ 4, 4 SAY "(718) 469-XXXX immediately"
  478. @ 5, 4 SAY "and report this problem."
  479. SET COLOR TO W/N
  480. DO a_lert
  481. CLEAR TYPEAHEAD
  482. @ 7, 9 SAY "Press any key..."
  483. = INKEY(0,"M")
  484. SET CONSOLE OFF
  485. * ==================
  486. *$ Store info to PROERROR.DBF
  487. * ==================
  488. SELECT 0
  489. USE proerror
  490. * =======================================
  491. * Error file is opened for use while other
  492. * previously opened files are kept open so the
  493. * information on what databases and indexes were
  494. * open at the time of the error can be stored in
  495. * the record for reference purposes.
  496. * ========================================
  497. APPEND BLANK
  498. REPLACE er_no WITH xerno, er_msg WITH xmsg, ;
  499.     kode WITH xkode, mmodul WITH xmodul, ddate ;
  500.     WITH DATE(), ttime WITH TIME(), line_no WITH xline
  501. SET SAFETY OFF
  502. STORE SYS(3) + ".TXT" TO ffile
  503. * ======================================
  504. * Note use of indirect referencing instead
  505. * of the ¯o substitution
  506. * ======================================
  507. LIST MEMO TO (ffile)
  508. APPEND MEMO notes FROM (ffile)
  509. LIST STATUS TO (ffile)
  510. APPEND MEMO notes FROM (ffile)
  511. CLOSE DATA
  512. ERASE (ffile)
  513. DEACTIVATE WINDOW bugbox
  514. CLEAR windows
  515. RETURN
  516. * End Procedure Nofile
  517.  
  518.  
  519. *!*********************************************************************
  520. *!
  521. *!      Procedure: PROFATAL
  522. *!
  523. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  524. *!
  525. *!           Uses: PROERROR.DBF   
  526. *!               : &FFILE.DBF     
  527. *!
  528. *!*********************************************************************
  529. PROCEDURE profatal
  530. ***********************************************************************
  531. *& Save error information to database or retry
  532. *
  533. *   NOTE: This routine is specific to FoxPro.
  534. *
  535. *   Information is stored to the PROERROR.DBF file and then
  536. *   the user is returned to master calling program if a RETRY
  537. *   is not issued.
  538. *
  539. *   This module can also be used independently for debugging by 
  540. *   issuing the following ON ERROR statement:
  541. *
  542. *   ON ERROR DO PROFATAL WITH ERROR(), MESSAGE(), MESSAGE(1), ;
  543. *      SYS(16), LINENO(), SYS(1O3), SYS(100), SYS(101), LASTKEY(), ;
  544. *      DBF(), SYS(18)
  545. *
  546. *  Parameters are:
  547. *
  548. *        xerno =  The numeric code of the number provided by ERROR()
  549. *        xmsg =   The error message provided by MESSAGE()
  550. *        xkode =  The contents of the line of code which
  551. *                  triggered the error as provided by MESSAGE(1)
  552. *        xmodul = The name of the code module, SYS(16)
  553. *        xline =  The number of the line of code triggering the
  554. *                  error, LINENO()
  555. *        xprint = Current PRINTER setting as per SYS(103)
  556. *        xkonsol= Current CONSOLE setting as per SYS(100)
  557. *        xdevice= Current DEVICE setting as per SYS(101)
  558. *         keypress = LASTKEY()
  559. *        curr_dbf = Selected .DBF when error occurred
  560. *        getfield = Field of GET...READ at time error occurred
  561. *
  562. *  In addition to this data, the routine saves the information from
  563. *   DISPLAY MEMORY and DISPLAY STATUS is saved to the memo field.
  564. *
  565. *  Note that if the .PRG file is not available or the COMPILE NODEBUG
  566. *  command has been utilized the contents of the line of code and the
  567. *  line number of the line of code which triggered the error will not
  568. *  be available.
  569. *
  570. *  Author: Pat Adams, DB Unlimited    (718) 469-XXXX
  571. *     Date: 4/20/90
  572. *     Last modified: 9/4/90
  573. *     Copyright 1989 DB Unlimited
  574. *     All rights reserved
  575. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  576. PARA xerno, xmsg, xkode, xmodul, xline, xprint, xkonsol, xdevice, ;
  577.     keypress, curr_dbf, getfield
  578. SET TALK OFF
  579. SET ESCAPE OFF
  580. SET CURSOR OFF
  581. * ================================
  582. * Pop up window to inform user about error
  583. * ===============================
  584. DEFINE WINDOW xfatal FROM 6,8 TO 16,42 DOUBLE ;
  585.     SHADOW COLOR +W/N, +W/N, +*R/R
  586. ACTIVATE WINDOW xfatal
  587. @ 1, 1 SAY "  One of those FATAL errors"
  588. @ 2, 1 SAY "  has occurred! "
  589. @ 4, 1 SAY "  Would you like to see the "
  590. @ 5, 1 SAY "  error message and code that"
  591. @ 6, 1 SAY "  created the condition? "
  592. CLEAR TYPEAHEAD
  593. * =====================
  594. * Sound a Bronx cheer
  595. * ====================
  596. DO razberry
  597. @ 8, 1 SAY "      (Enter Y or N)  "
  598. * =================================
  599. * Error Trapping for Yes/No Response
  600. * with SUSPEND activated via ESC key
  601. * =================================
  602. STORE 0 TO kkey
  603.  
  604. DO WHILE kkey = 0
  605.     kkey = INKEY()
  606.     
  607.     IF kkey > 0
  608.         * =============================
  609.         * Function keys 2 thru 9 return
  610.         * negative values.  This sets up
  611.         * error trapping for that condition.
  612.         * =============================
  613.         IF CHR(kkey) $ "YyNn"
  614.             STORE CHR(kkey) TO viewit
  615.         ELSE
  616.             IF kkey <> 27
  617.                 STORE 0 TO kkey
  618.             ENDIF kkey <> 27
  619.         ENDIF chr(kkey) $
  620.     ELSE
  621.         STORE 0 TO kkey
  622.     ENDIF kkey > 0
  623. ENDDO while kkey = 0
  624.  
  625. ACTIVATE SCREEN
  626. SET CONSOLE OFF
  627. * ==================
  628. *$ Store info to PROERROR.DBF
  629. * ==================
  630. SELECT 0
  631. USE proerror
  632. * =======================================
  633. * Error file is opened for use while other
  634. * previously opened files are kept open so the
  635. * information on what databases and indexes were
  636. * open at the time of the error can be stored in
  637. * the record for reference purposes.
  638. * ========================================
  639. APPEND BLANK
  640. REPLACE er_no WITH xerno, er_msg WITH xmsg, ;
  641.     kode WITH xkode, mmodul WITH xmodul, ddate ;
  642.     WITH DATE(), ttime WITH TIME(), line_no WITH xline
  643. SET SAFETY OFF
  644. STORE SYS(3) + ".TXT" TO ffile
  645. * ======================================
  646. * Note use of indirect referencing instead
  647. * of the ¯o substitution
  648. * ======================================
  649. LIST MEMO TO (ffile)
  650. APPEND MEMO notes FROM (ffile)
  651. LIST STATUS TO (ffile)
  652. APPEND MEMO notes FROM (ffile)
  653. ERASE (ffile)
  654. SET ESCAPE ON
  655. ON ESCAPE SUSPEND
  656. SET CONSOLE ON
  657.  
  658. IF UPPER(viewit) = "Y"
  659.     * ==================================
  660.     * Clear out the ON ESCAPE SUSPEND and permit
  661.     * user to BROWSE to see the error information.
  662.     * Escape key is now utilized to exit the BROWSE.
  663.     * ==================================
  664.     ON ESCAPE
  665.     SET ESCAPE ON
  666.     ?? SYS(2002,1)        && Turn on cursor
  667.     GO BOTTOM
  668.     DEFINE WINDOW fbrowse FROM 2,2 TO 22,72 PANEL ;
  669.         CLOSE FLOAT GROW SHADOW ZOOM COLOR W+/B, GR+/BG, R+
  670.     BROWSE FIELDS er_no:5, er_msg:20, kode:20, ;
  671.         mmodul:12, ddate:8, ttime:8, line_no:8, ;
  672.         notes:6 NOMODIFY WINDOW fbrowse
  673.     DEACTIVATE WINDOW fbrowse
  674.     RELEASE WINDOW fbrowse
  675. ENDIF upper(viewit) = "Y"
  676.  
  677. CLOSE DATA
  678. DEACTIVATE WINDOW xfatal
  679. RELEASE WINDOW xfatal
  680. ON KEY                          && Clear out ON KEY LABELs
  681. RETURN TO MASTER
  682. * END Procedure Profatal
  683.  
  684.  
  685. *!*********************************************************************
  686. *!
  687. *!      Procedure: RAZBERRY
  688. *!
  689. *!      Called by: PROFATAL       (procedure in PROERROR.PRG)
  690. *!               : FILEBUSY       (procedure in PROERROR.PRG)
  691. *!               : REC_BUSY       (procedure in PROERROR.PRG)
  692. *!               : INDEX_ER       (procedure in PROERROR.PRG)
  693. *!               : READONLY       (procedure in PROERROR.PRG)
  694. *!               : NOACCESS       (procedure in PROERROR.PRG)
  695. *!               : NOCREATE       (procedure in PROERROR.PRG)
  696. *!               : NO_OPEN        (procedure in PROERROR.PRG)
  697. *!               : KORRUPT        (procedure in PROERROR.PRG)
  698. *!               : READ_ERR       (procedure in PROERROR.PRG)
  699. *!               : RITE_ERR       (procedure in PROERROR.PRG)
  700. *!               : MIXUP          (procedure in PROERROR.PRG)
  701. *!               : INVALPRN       (procedure in PROERROR.PRG)
  702. *!               : LOWFILES       (procedure in PROERROR.PRG)
  703. *!               : WORKSPAC       (procedure in PROERROR.PRG)
  704. *!
  705. *!*********************************************************************
  706. PROCEDURE razberry
  707. ***********************************************************************
  708. *& Sound chime as a "raspberry" or Bronx cheer
  709. *
  710. *  Author: Pat Adams, DB Unlimited  7/24/89
  711. *     Copyright 1989 DB Unlimited
  712. *
  713. * * * * * * * * * * * * * * * * * * * * *
  714. SET BELL TO 30,15
  715. ?? CHR(7)
  716. SET BELL TO 512,2    && Return bell to normal setting
  717. RETURN
  718. * End Procedure Razberry
  719.  
  720.  
  721. *!*********************************************************************
  722. *!
  723. *!      Procedure: A_LERT
  724. *!
  725. *!      Called by: NOFILE         (procedure in PROERROR.PRG)
  726. *!               : REALBAD1       (procedure in PROERROR.PRG)
  727. *!               : TRASHED        (procedure in PROERROR.PRG)
  728. *!               : BADCHAIN       (procedure in PROERROR.PRG)
  729. *!               : NOSPACE        (procedure in PROERROR.PRG)
  730. *!               : NOTREADY       (procedure in PROERROR.PRG)
  731. *!
  732. *!*********************************************************************
  733. PROCEDURE a_lert
  734. ************************************************************************
  735. *&    Sound warning siren
  736. *
  737. *   Author: Pat Adams, DB Unlimited  (718) 469-XXXX
  738. *   Date: 2/5/90
  739. *   Copyright 1990 DB Unlimited
  740. *   All rights reserved
  741. *
  742. * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  743. FOR il = 1 TO 3
  744.     FOR xx = 1 TO 4
  745.         SET BELL TO 1650-(18*xx), 3
  746.         ?? CHR(7)
  747.         SET BELL TO 650-(5*xx),3
  748.         ?? CHR(7)
  749.     ENDFOR
  750. ENDFOR
  751.  
  752. SET BELL TO 512,2       && Return bell to normal setting
  753. RETURN
  754. * End Procedure A_LERT
  755.  
  756.  
  757. *!*********************************************************************
  758. *!
  759. *!      Procedure: FILEBUSY
  760. *!
  761. *!      Called by: PROERROR.PRG                  
  762. *!
  763. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  764. *!
  765. *!*********************************************************************
  766. PROCEDURE filebusy
  767. ***********************************************************************
  768. *& Inform user file is in use & provide option to retry
  769. *
  770. *  Passed parameter is a logical .F. which is returned
  771. *  as a .T. or .F., depending upon whether user wants to
  772. *  retry for use of the file.
  773. *
  774. *    Author: Pat Adams, DB Unlimited    
  775. *   Date: 4/28/90
  776. *   Copyright 1990 DB Unlimited
  777. *   All rights reserved
  778. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  779. PARAMETER tryagain
  780. DEFINE WINDOW bugbox FROM 6,22 TO 15,57 PANEL SHADOW ;
  781.     COLOR W+/N,N/W,R+*/R 
  782. ACTIVATE WINDOW bugbox
  783. SET CURSOR OFF
  784. SET COLOR TO *+W/N
  785. @ 1,13 SAY "SORRY!"
  786. SET ESCAPE OFF
  787. SET COLOR TO +W/N
  788. @ 3, 2 SAY "The file you need is in use"
  789. @ 4, 2 SAY "by someone else right now."
  790. DO razberry
  791. CLEAR TYPEAHEAD
  792. @ 6, 2 SAY "Do you want to try again? (Y/N)"
  793. * ====================================
  794. * Error user trapping for Y/N response
  795. * ====================================
  796. DO yes_no WITH tryagain
  797. DEACTIVATE WINDOW bugbox
  798. RELEASE WINDOW bugbox
  799. RETURN tryagain
  800. * END Procedure Filebusy
  801.  
  802.  
  803. *!*********************************************************************
  804. *!
  805. *!      Procedure: REC_BUSY
  806. *!
  807. *!      Called by: PROERROR.PRG                  
  808. *!
  809. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  810. *!
  811. *!*********************************************************************
  812. PROCEDURE rec_busy
  813. **********************************************************************
  814. *& Record in use by another.  Inform user & provide option to retry.
  815. *
  816. *  Passed parameter is a logical .F. which is returned
  817. *  as a .T. or .F., depending upon whether user wants to
  818. *  retry for use of the record.
  819. *
  820. *    Author: Pat Adams, DB Unlimited
  821. *   Date: 4/28/90
  822. *   Copyright 1990 DB Unlimited
  823. *   All rights reserved
  824. *
  825. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  826. PARAMETER tryagain
  827. DEFINE WINDOW bugbox FROM 6,22 TO 15,57 PANEL SHADOW ;
  828.     COLOR W+/N,N/W,R+*/R
  829. ACTIVATE WINDOW bugbox
  830. SET CURSOR OFF
  831. SET COLOR TO *+W/N
  832. @ 1,13 SAY "SORRY!"
  833. SET ESCAPE OFF
  834. SET COLOR TO +W/N
  835. @ 3, 2 SAY "The record you want is in use"
  836. @ 4, 2 SAY "by someone else right now."
  837. CLEAR TYPEAHEAD
  838. DO razberry
  839. @ 6, 2 SAY "Do you want to try again? (Y/N)"
  840. * ========================================
  841. * Error trapping for user Y/N response
  842. * ========================================
  843. DO yes_no WITH tryagain
  844. DEACTIVATE WINDOW bugbox
  845. RELEASE WINDOW bugbox
  846. RETURN tryagain
  847. * End Procedure REC_BUSY
  848.  
  849.  
  850. *!*********************************************************************
  851. *!
  852. *!      Procedure: INDEX_ER
  853. *!
  854. *!      Called by: PROERROR.PRG                  
  855. *!
  856. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  857. *!
  858. *!*********************************************************************
  859. PROCEDURE index_er
  860. ***********************************************************************
  861. *& Record is out of range error message
  862. *  or Record is not in index error message.
  863. *  This usually means an index has been corrupted
  864. *  or the data or database was changed without the
  865. *  index active.
  866. *
  867. *  Also handles the index damaged error message
  868. *  Pop up message to user and then quit to main menu.
  869. *
  870. *  The actual message to the user will need to be
  871. *  modified for the particulars of each system.
  872. *
  873. *    Author: Pat Adams, DB Unlimited 
  874. *   Date: 4/28/90
  875. *   Copyright 1990 DB Unlimited
  876. *   All rights reserved
  877. *
  878. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  879. DEFINE WINDOW bugbox FROM 4,19 TO 19,53 PANEL ;
  880.     SHADOW COLOR W+/N,N/W,GR+*/R
  881. ACTIVATE WINDOW bugbox
  882.  
  883. SET CURSOR OFF
  884. SET COLOR TO *+GR/N
  885. @ 1, 8 SAY "  BAD NEWS  "
  886. SET COLOR TO +W/N
  887. @ 3, 2 SAY "There is a problem with the"
  888. @ 4, 2 SAY "index(s) needed for this"
  889. @ 5, 2 SAY "routine."
  890. @ 7, 2 SAY "You will be returned to the"
  891. @ 8, 2 SAY "Main Menu.  From there please"
  892. @ 9, 2 SAY "select the appropriate"
  893. @10, 2 SAY "maintenance function to fix"
  894. CLEAR TYPEAHEAD
  895. @11, 2 SAY "the index."
  896. DO razberry
  897. SET COLOR TO W/N
  898. @13, 2 SAY "Press any key..."
  899. = INKEY(0, "M")
  900. DEACTIVATE WINDOW bugbox
  901. RELEASE WINDOW bugbox
  902. RETURN
  903. * END Procedure Index_er
  904.  
  905.  
  906. *!*********************************************************************
  907. *!
  908. *!      Procedure: READONLY
  909. *!
  910. *!      Called by: PROERROR.PRG                  
  911. *!
  912. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  913. *!
  914. *!*********************************************************************
  915. PROCEDURE readonly
  916. ***********************************************************************
  917. *& Cannot write to a read-only file.
  918. *
  919. *  Attempt has been made to use a file created for read only purposes.
  920. *
  921. *  Inform user with message to call me since this is most likely a
  922. *  programming error, and return user to Main Menu.
  923. *
  924. *    Author: Pat Adams, DB Unlimited    (718) 469-XXXX
  925. *   Date: 4/28/90
  926. *   Copyright 1990 DB Unlimited
  927. *   All rights reserved
  928. *
  929. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  930. *
  931. DEFINE WINDOW bugbox FROM 4,22 TO 19,57 PANEL SHADOW ;
  932.     COLOR W+/N,N/W,GR+*/R
  933. ACTIVATE WINDOW bugbox
  934. SET COLOR TO *+GR/N
  935. SET CURSOR OFF
  936. @ 1, 9 SAY "   SORRY   "
  937. SET COLOR TO +W/N
  938. @ 3, 2 SAY "Something has gone wrong and"
  939. @ 4, 2 SAY "the system is attempting to"
  940. @ 5, 2 SAY "write to a read only file."
  941. @ 7, 2 SAY "Please call Pat Adams at DB"
  942. @ 8, 2 SAY "Unlimited (718-469-XXXX) and"
  943. @ 9, 2 SAY "report this problem."
  944. SET COLOR TO W/N
  945. DO razberry
  946. CLEAR TYPEAHEAD
  947. @11, 2 SAY "Press any key to"
  948. @12, 2 SAY "return to the Main Menu..."
  949. = INKEY(0, "M")
  950. DEACTIVATE WINDOW bugbox
  951. RELEASE WINDOW bugbox
  952. RETURN
  953. * END Procedure Readonly
  954.  
  955.  
  956. *!*********************************************************************
  957. *!
  958. *!      Procedure: NOACCESS
  959. *!
  960. *!      Called by: PROERROR.PRG                  
  961. *!
  962. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  963. *!
  964. *!*********************************************************************
  965. PROCEDURE noaccess
  966. **********************************************************************
  967. *$ File access denied
  968. *
  969. *  Attempt has been made to write to a file that is
  970. *  read only.  This may  arise for several reasons:
  971. *
  972. *     1.  File is protected by the DOS
  973. *        ATTRIB command as read only
  974. *
  975. *    2.  User rights have not been
  976. *        configured properly for this
  977. *        users LAN access.  Note that
  978. *        a .DBF file may be opened  (for purposes
  979. *        of reading or copying the file) with
  980. *        read only rights on a LAN but
  981. *        index files require both read and
  982. *        write rights.
  983. *
  984. *    3.  Most LANs, such as Novell, utilize bytes not utilized
  985. *        by DOS to store information about whether the LAN
  986. *        attribute(s) for the file are read only, etc.  Something
  987. *        may have changed the LAN attributes for this file to
  988. *        read only.
  989. *
  990. *    4.   File is in use by another.  This routine
  991. *         tests the line of code which caused the error and
  992. *         if it contains a USE EXCL statement advises the user
  993. *        that someone else has use of the file.  Error #3 should
  994. *        be returned in this circumstance but certain DOS based
  995. *        LANs such as InvisibleNet erroneously return error 1705.
  996. *
  997. *    Author: Pat Adams, DB Unlimited  
  998. *   Date: 4/28/90
  999. *   Last Modified: 12/4/90
  1000. *     IF statement added to check for erroneous
  1001. *     error 1705.
  1002. *
  1003. *   Copyright 1990 DB Unlimited
  1004. *   All rights reserved
  1005. *
  1006. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1007. PARAMETERS doagain, kodeline 
  1008. SET CURSOR OFF
  1009.  
  1010. IF ATC("EXCL", kodeline) <> 0
  1011. * =============================================
  1012. * Required file is in use by another.
  1013. * An exclusive use of file can not be obtained.
  1014. * Advise user and provide opportunity to retry
  1015. * for the required file.
  1016. * =============================================
  1017.     SET ESCAPE OFF
  1018.     DEFINE WINDOW BOX1 FROM 7,24 TO 16,56 PANEL;
  1019.         SHADOW COLOR W+/N,N/W,GR*+/GR+ 
  1020.     ACTIVATE WINDOW BOX1
  1021.     SET COLOR TO *+GR/N
  1022.     @ 0,11 SAY " SORRY "
  1023.     SET COLOR TO +W/N
  1024.     @ 2, 3 SAY "Someone else is using the"
  1025.     @ 3, 3 SAY "file you need exclusively."
  1026.     @ 5, 2 SAY "Would you like to try again?"
  1027.     SET COLOR TO W/N
  1028.     @ 7, 9 SAY "(Enter Y or N)"
  1029.     * =================================
  1030.     * Error Trapping for user Yes/No Response 
  1031.     * =================================
  1032.     DO yes_no WITH doagain
  1033.     SET ESCAPE ON    
  1034.     DEACTIVATE WINDOW box1
  1035.     RELEASE WINDOW box1
  1036. ELSE
  1037. * =============================================
  1038. * Other conditions have created the error.
  1039. * Advise user and abort remainder of the routine.
  1040. * =============================================
  1041.     STORE .F. TO doagain
  1042.     DEFINE WINDOW bugbox FROM 4,19 TO 22,63 PANEL SHADOW ;
  1043.         COLOR W+/N,N/W,GR+*/R
  1044.     ACTIVATE WINDOW bugbox
  1045.     SET COLOR TO *+GR/N
  1046.     SET CURSOR OFF
  1047.     @ 1,13 SAY "   WHOOPS   "
  1048.     SET COLOR TO +W/N
  1049.     @ 3,2 SAY "One of several conditions has occurred."
  1050.     @ 5,2 SAY "Someone else has the file(s) you need"
  1051.     @ 6,2 SAY "in exclusive use, you do not have the"
  1052.     @ 7,2 SAY "appropriate user rights on the LAN, or"
  1053.     @ 8,2 SAY "the file(s) you need have been flagged"
  1054.     @ 9,2 SAY "as read only."
  1055.     @ 11,2 SAY "If this message continually appears"
  1056.     @ 12,2 SAY "please call your LAN administrator."
  1057.     DO razberry
  1058.     CLEAR TYPEAHEAD
  1059.     SET COLOR TO W/N
  1060.     @ 15, 2 SAY "Press any key to"
  1061.     @ 16, 2 SAY "return to the Main Menu..."
  1062.     = INKEY(0, "M")
  1063.     DEACTIVATE WINDOW bugbox
  1064.     RELEASE WINDOW bugbox
  1065. ENDIF  ATC("EXCL", kodeline) <> 0
  1066.  
  1067. RETURN doagain
  1068. * END Procedure Noaccess
  1069.  
  1070.  
  1071. *!*********************************************************************
  1072. *!
  1073. *!      Procedure: NOCREATE
  1074. *!
  1075. *!      Called by: PROERROR.PRG                  
  1076. *!
  1077. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1078. *!
  1079. *!*********************************************************************
  1080. PROCEDURE nocreate
  1081. ***********************************************************************
  1082. *& Error 1102 - Can not create file
  1083. *
  1084. *    This usually occurs because:
  1085. *
  1086. *    1.    The disk or directory is full
  1087. *
  1088. *    2.  An invalid file name is being utilized.  Check for
  1089. *       blank spaces and occurrances of other characters not
  1090. *       acceptable to DOS and/or FoxPro.
  1091. *
  1092. *   3.  User may not have correct LAN user rights.
  1093. *
  1094. *   4.  An attempt is being made to write over an existing
  1095. *       file which has been flagged as read only.
  1096. *
  1097. *    Author: Pat Adams, DB Unlimited 
  1098. *   Date: 4/28/90
  1099. *   Copyright 1990 DB Unlimited
  1100. *   All rights reserved
  1101. *
  1102. * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1103. *
  1104. DEFINE WINDOW bugbox FROM 2,13 TO 21,66 PANEL SHADOW ;
  1105.     COLOR W+/N,N/W,GR+*/R 
  1106. ACTIVATE WINDOW bugbox
  1107. SET COLOR TO +*GR/N
  1108. SET CURSOR OFF
  1109. @ 1,16 SAY "   WHOOPS   "
  1110. SET COLOR TO +W/N
  1111. @ 3, 3 SAY "The operating system will not permit creation"
  1112. @ 4, 3 SAY "of a file which is required.  This may arise"
  1113. @ 5, 3 SAY "for several reasons:"
  1114. @ 7, 5 SAY "1.  You do not have the correct LAN rights."
  1115. @ 8, 9 SAY "Call your LAN administrator."
  1116. @10, 5 SAY "2.  The disk or subdirectory is full."
  1117. @12, 5 SAY "3.  You are trying to use an invalid name."
  1118. @14, 5 SAY "4.  A read-only file of the same name exists."
  1119. SET COLOR TO W/N
  1120. DO razberry
  1121. CLEAR TYPEAHEAD
  1122. @16, 2 SAY "Press any key to"
  1123. @17, 2 SAY "return to the Main Menu..."
  1124. = INKEY(0, "M")
  1125. DEACTIVATE WINDOW bugbox
  1126. RELEASE WINDOW bugbox
  1127. RETURN
  1128. * END Procedure Nocreate
  1129.  
  1130.  
  1131. *!*********************************************************************
  1132. *!
  1133. *!      Procedure: NO_OPEN
  1134. *!
  1135. *!      Called by: PROERROR.PRG                  
  1136. *!
  1137. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1138. *!
  1139. *!*********************************************************************
  1140. PROCEDURE no_open
  1141. ***********************************************************************
  1142. *& Error 1101 - Cannot open file
  1143. *
  1144. *    This usually occurs because:
  1145. *
  1146. *    1.    User does not have correct LAN rights.
  1147. *
  1148. *    2.  File does not exist - probably inadvertently erased.
  1149. *
  1150. *    Author: Pat Adams, DB Unlimited  
  1151. *   Date: 4/28/90
  1152. *   Copyright 1990 DB Unlimited
  1153. *   All rights reserved
  1154. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1155. *
  1156. DEFINE WINDOW bugbox FROM 3,13 TO 18,66 PANEL SHADOW ;
  1157.     COLOR W+/N,N/W,GR+*/R 
  1158. ACTIVATE WINDOW bugbox
  1159. SET CURSOR OFF
  1160. SET COLOR TO *+GR/N
  1161. @ 1,18 SAY "   SORRY   "
  1162. SET COLOR TO +W/N
  1163. @ 3, 2 SAY "The system is unable to open the file you need."
  1164. @ 5, 2 SAY "One of two things may have happened:"
  1165. @ 7, 4 SAY "1.  You do not have the correct user rights"
  1166. @ 8, 8 SAY "on the LAN.  Call your LAN administrator."
  1167. @10, 4 SAY "2.  The file has been erased."
  1168. SET COLOR TO W/N
  1169. DO razberry
  1170. CLEAR TYPEAHEAD
  1171. @12,24 SAY "Press any key to"
  1172. @13,24 SAY "return to the Main Menu..."
  1173. = INKEY(0, "M")
  1174. DEACTIVATE WINDOW bugbox
  1175. RELEASE WINDOW bugbox
  1176. RETURN
  1177. * END Procedure No_open
  1178.  
  1179.  
  1180. *!*********************************************************************
  1181. *!
  1182. *!      Procedure: REALBAD1
  1183. *!
  1184. *!      Called by: PROERROR.PRG                  
  1185. *!
  1186. *!          Calls: A_LERT         (procedure in PROERROR.PRG)
  1187. *!
  1188. *!*********************************************************************
  1189. PROCEDURE realbad1
  1190. ***********************************************************************
  1191. *& Error 1157 - Cannot update file
  1192. *
  1193. *  This is a very serious error.  A problem has occurred
  1194. *  when attempting to write to the disk.  The problem is
  1195. *  not with FoxPro but rather with DOS or the hardware.
  1196. *  The most likely causes are:
  1197. *
  1198. *    1.  The disk/directory is full;
  1199. *
  1200. *    2.  The hard disk has failed.
  1201. *
  1202. *
  1203. *    Author: Pat Adams, DB Unlimited 
  1204. *   Date: 4/28/90
  1205. *   Copyright 1990 DB Unlimited
  1206. *   All rights reserved
  1207. * * * * * * * * * * * * * * * * * * * * * * * * *
  1208. *
  1209. DEFINE WINDOW bugbox FROM 3,18 TO 17,61 PANEL SHADOW ;
  1210.     COLOR W+/N,N/W,GR+*/R 
  1211. ACTIVATE WINDOW bugbox
  1212. SET CURSOR OFF
  1213. SET COLOR TO *+GR/N
  1214. @ 1, 9 SAY "   VERY BAD NEWS   "
  1215. SET COLOR TO +W/N
  1216. @ 3, 2 SAY "A hardware error has occurred."
  1217. @ 5, 2 SAY "Your disk or directory may be full"
  1218. @ 6, 2 SAY "or there may be a disk failure."
  1219. @ 8, 2 SAY "Call your LAN administrator immediately"
  1220. SET COLOR TO W/N
  1221. CLEAR TYPEAHEAD
  1222. @ 9, 2 SAY "to report this!"
  1223. @12, 9 SAY "Press any key to return to DOS..."
  1224.  
  1225. FOR jj = 1 TO 3
  1226.     * =====================================
  1227.     * Sound the alert siren several times
  1228.     * =====================================
  1229.     DO a_lert
  1230. ENDFOR
  1231. = INKEY(0, "M")
  1232. DEACTIVATE WINDOW bugbox
  1233. RELEASE WINDOW bugbox
  1234. RETURN
  1235. * END Procedure realbad1
  1236.  
  1237.  
  1238. *!*********************************************************************
  1239. *!
  1240. *!      Procedure: TRASHED
  1241. *!
  1242. *!      Called by: PROERROR.PRG                  
  1243. *!
  1244. *!          Calls: A_LERT         (procedure in PROERROR.PRG)
  1245. *!
  1246. *!*********************************************************************
  1247. PROCEDURE trashed
  1248. ***********************************************************************
  1249. *& Error 1115 - Database record is trashed
  1250. *
  1251. *   [Pray that user has made a backup recently]
  1252. *
  1253. *    Author: Pat Adams, DB Unlimited   
  1254. *   Date: 4/28/90
  1255. *   Copyright 1990 DB Unlimited
  1256. *   All rights reserved
  1257. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1258. *
  1259. DEFINE WINDOW bugbox FROM 5,22 TO 17,58 PANEL SHADOW ;
  1260.     COLOR W+/N,N/W,GR+*/R 
  1261. ACTIVATE WINDOW bugbox
  1262. SET CURSOR OFF
  1263. SET COLOR TO *+GR/N
  1264. @ 1, 2 SAY "   THE WORST HAS HAPPENED   "
  1265. SET COLOR TO +W/N
  1266. @ 3, 2 SAY "A database has been trashed!"
  1267. @ 5, 2 SAY "You must restore from your most"
  1268. @ 6, 2 SAY "recent backup or call Pat Adams"
  1269. @ 7, 2 SAY "at DB Unlimited (718-469-XXXX)."
  1270. SET COLOR TO W/N
  1271. CLEAR TYPEAHEAD
  1272. @ 9, 2 SAY "Press any key to"
  1273. @10, 2 SAY "return to Main Menu..."
  1274.  
  1275. FOR jj = 1 TO 5
  1276.     * ==============================
  1277.     * Sound warning siren loud & long
  1278.     * ==============================
  1279.     DO a_lert
  1280. ENDFOR
  1281.  
  1282. = INKEY(0, "M")
  1283. DEACTIVATE WINDOW bugbox
  1284. RELEASE WINDOW bugbox
  1285. RETURN
  1286. * End Procedure Trashed
  1287.  
  1288.  
  1289.  
  1290. *!*********************************************************************
  1291. *!
  1292. *!      Procedure: KORRUPT
  1293. *!
  1294. *!      Called by: PROERROR.PRG                  
  1295. *!
  1296. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1297. *!
  1298. *!*********************************************************************
  1299. PROCEDURE korrupt
  1300. ***********************************************************************
  1301. *& Error 67 = Expression evaluator fault
  1302. *
  1303. *    There is an internal consistency check failure in the
  1304. *   FoxPro expression evaluator.  The most likely cause is
  1305. *   corruption in the compiled object code file.
  1306. *
  1307. *    Author: Pat Adams, DB Unlimited 
  1308. *   Date: 4/28/90
  1309. *   Copyright 1990 DB Unlimited
  1310. *   All rights reserved
  1311. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1312. *
  1313. DEFINE WINDOW bugbox FROM 3, 8 TO 19,71 PANEL SHADOW ;
  1314.     COLOR W+/N,N/W,GR+*/R 
  1315. ACTIVATE WINDOW bugbox
  1316. SET CURSOR OFF
  1317. SET COLOR TO *+GR/N
  1318. @ 1,21 SAY "   BAD NEWS   "
  1319. SET COLOR TO +W/N
  1320. @ 3, 2 SAY "Something seems to have corrupted your compiled code file."
  1321. @ 5, 2 SAY "Options are:"
  1322. @ 7, 2 SAY "1.  Return to DOS and copy a fresh version onto the disk"
  1323. @ 9, 2 SAY "2.  Recompile from the ASCII text source code"
  1324. @11, 2 SAY "3.  Call Pat Adams at DB Unlimited (718-469-XXXX)"
  1325. SET COLOR TO W/N
  1326. CLEAR TYPEAHEAD
  1327. DO razberry
  1328. @14, 9 SAY "Press any key to return to Main Menu..."
  1329. = INKEY(0, "M")
  1330. DEACTIVATE WINDOW bugbox
  1331. RELEASE WINDOW bugbox
  1332. RETURN
  1333. * End PROCEDURE korrupt
  1334.  
  1335.  
  1336. *!*********************************************************************
  1337. *!
  1338. *!      Procedure: READ_ERR
  1339. *!
  1340. *!      Called by: PROERROR.PRG                  
  1341. *!
  1342. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1343. *!
  1344. *!*********************************************************************
  1345. PROCEDURE read_err
  1346. ***********************************************************************
  1347. *& Error 1104 - File read error
  1348. *
  1349. *  The operating system returned an error to FoxPro
  1350. *  while FoxPro was attempting to read a file.  It could
  1351. *  just be a "hiccup" or there could be problems with the
  1352. *  disk.  Provide user with option to retry.
  1353. *
  1354. *    Author: Pat Adams, DB Unlimited   
  1355. *   Date: 4/28/90
  1356. *   Copyright 1990 DB Unlimited
  1357. *   All rights reserved
  1358. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1359. PARAMETERS rretry
  1360. DEFINE WINDOW bugbox FROM 3,19 TO 20,61 PANEL SHADOW ;
  1361.     COLOR W+/N,N/W,R+*/R 
  1362. ACTIVATE WINDOW bugbox
  1363. SET COLOR TO *+R/N
  1364. SET CURSOR OFF
  1365. @ 1,11 SAY "   BAD NEWS   "
  1366. SET COLOR TO +W/N
  1367. @ 3, 2 SAY "Your hardware and/or operating system"
  1368. @ 4, 2 SAY "returned an error during an attempt"
  1369. @ 5, 2 SAY "to read a file."
  1370. @ 7, 2 SAY "It may be that there was just a minor"
  1371. @ 8, 2 SAY "'hiccup' or you may be experiencing"
  1372. @ 9, 2 SAY "hardware problems.  If this is the"
  1373. @10, 2 SAY "first time you have received this"
  1374. @11, 2 SAY "error message try things again.  If"
  1375. @12, 2 SAY "not, quit and check your disk, con-"
  1376. @13, 2 SAY "troller and LAN connections."
  1377. SET COLOR TO +GR/N
  1378. CLEAR TYPEAHEAD
  1379. DO razberry
  1380. @15, 6 SAY "Do you want to retry?  (Y/N)"
  1381. * =====================================
  1382. * Error trapping for user Y/N response
  1383. * =====================================
  1384. DO yes_no WITH rretry
  1385. DEACTIVATE WINDOW bugbox
  1386. RELEASE WINDOW bugbox
  1387. RETURN rretry
  1388. * End Procedure Read_err
  1389.  
  1390. *!*********************************************************************
  1391. *!
  1392. *!      Procedure: RITE_ERR
  1393. *!
  1394. *!      Called by: PROERROR.PRG                  
  1395. *!
  1396. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1397. *!
  1398. *!*********************************************************************
  1399. PROCEDURE rite_err
  1400. ************************************************************************
  1401. *& Error 1105 - File write error
  1402. *
  1403. *  Operating system error returned while FoxPro was attempting
  1404. *  to write to a file or create a new file.  Usually occurs
  1405. *  when a diskette has been write protected.
  1406. *
  1407. *  Advise user & provide option to retry.
  1408. *
  1409. *    Author: Pat Adams, DB Unlimited  
  1410. *   Date: 4/28/90
  1411. *   Copyright 1990 DB Unlimited
  1412. *   All rights reserved
  1413.  
  1414. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1415. PARAMETERS rretry
  1416. DEFINE WINDOW bugbox FROM 5,21 TO 15,58 PANEL SHADOW ;
  1417.     COLOR W+/N,N/W,R+*/R 
  1418. ACTIVATE WINDOW bugbox
  1419. SET COLOR TO *+R/N
  1420. @ 1,11 SAY CHR(4)+" "+CHR(4)+" SORRY "+CHR(4)+" "+CHR(4)
  1421. SET COLOR TO +W/N
  1422. @ 3, 2 SAY "There is a problem writing the"
  1423. @ 4, 2 SAY "file to disk.  Is it possible"
  1424. @ 5, 2 SAY "you have a write protected disk?"
  1425. CLEAR TYPEAHEAD
  1426. DO razberry
  1427. @ 7, 2 SAY "Do you want to retry this? (Y/N)"
  1428. * ==================================
  1429. *$ Error trapping for user Y/N response
  1430. * ==================================
  1431. DO yes_no WITH rretry
  1432. DEACTIVATE WINDOW bugbox
  1433. RELEASE WINDOW bugbox
  1434. RETURN rretry
  1435. * END Procedure rite_err
  1436.  
  1437.  
  1438. *!*********************************************************************
  1439. *!
  1440. *!      Procedure: MIXUP
  1441. *!
  1442. *!      Called by: PROERROR.PRG                  
  1443. *!
  1444. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1445. *!
  1446. *!*********************************************************************
  1447. PROCEDURE mixup
  1448. ************************************************************************
  1449. *& Error 19 - Index file does not match database.
  1450. *  Index expression includes fields not contained in
  1451. *  the database file.  Advise user & return to Main Menu.
  1452. *
  1453. *    Author: Pat Adams, DB Unlimited    (718) 469-XXXX
  1454. *   Date: 4/28/90
  1455. *   Copyright 1990 DB Unlimited
  1456. *   All rights reserved
  1457. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1458. DEFINE WINDOW bugbox FROM 5,18 TO 17,61 PANEL SHADOW ;
  1459.     COLOR W+/N,N/W,R+*/R 
  1460. ACTIVATE WINDOW bugbox
  1461. SET COLOR TO *+R/W
  1462. @ 1,14 SAY CHR(4)+" "+CHR(4)+" SORRY "+CHR(4)+" "+CHR(4)
  1463. SET COLOR TO +W/N
  1464. @ 3, 2 SAY "An attempt was made to use an index"
  1465. @ 4, 2 SAY "containing fields not in the database."
  1466. @ 6, 2 SAY "Please call Pat Adams at DB Unlimited"
  1467. @ 7, 2 SAY "(718-469-XXXX) to report this problem."
  1468. SET COLOR TO W/N
  1469. CLEAR TYPEAHEAD
  1470. DO razberry
  1471. @ 9, 2 SAY "Press any key to return to Main Menu..."
  1472. = INKEY(0, "M")
  1473. RETURN
  1474. * End Procedure Mixup
  1475.  
  1476.  
  1477. *!*********************************************************************
  1478. *!
  1479. *!      Procedure: INVALPRN
  1480. *!
  1481. *!      Called by: PROERROR.PRG                  
  1482. *!
  1483. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1484. *!
  1485. *!           Uses: PROERROR.DBF   
  1486. *!               : &FFILE.DBF     
  1487. *!
  1488. *!*********************************************************************
  1489. PROCEDURE invalprn
  1490. ***********************************************************************
  1491. *& Error 124 - Invalid printer redirection
  1492. *  which can only be fixed from DOS.
  1493. *
  1494. *  This normally occurs when attempts are made to share a non-
  1495. *  sharable printer on a LAN or the path to the print device
  1496. *  has not been properly defined.
  1497. *
  1498. *  Advise user & quit to DOS.
  1499. *
  1500. *    Author: Pat Adams, DB Unlimited   
  1501. *   Date: 4/28/90
  1502. *   Copyright 1990 DB Unlimited
  1503. *   All rights reserved
  1504. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1505. *
  1506. DEFINE WINDOW bugbox FROM 5,15 TO 17,64 PANEL SHADOW ;
  1507.     COLOR W+/N,N/W,R+*/R 
  1508. ACTIVATE WINDOW bugbox
  1509. SET COLOR TO *+R/N
  1510. @ 1,18 SAY CHR(4)+" "+CHR(4)+" SORRY "+CHR(4)+" "+CHR(4)
  1511. SET COLOR TO +W/N
  1512. @ 3, 2 SAY "An attempt was made to use an unavailable"
  1513. @ 4, 2 SAY "print device.  Either the printer you"
  1514. @ 5, 2 SAY "want is not sharable or the correct DOS"
  1515. @ 6, 2 SAY "PATH setting has not been made.  You must"
  1516. @ 7, 2 SAY "leave this system, return to DOS and fix"
  1517. @ 8, 2 SAY "things there.  Or call your LAN administrator."
  1518. SET COLOR TO W/N
  1519. CLEAR TYPEAHEAD
  1520. DO razberry
  1521. @10, 2 SAY "Press any key to return to DOS..."
  1522. = INKEY(0, "M")
  1523. DEACTIVATE WINDOW bugbox
  1524. RELEASE WINDOW bugbox
  1525. CLEAR
  1526. * ==========================
  1527. *$ Store info to error file
  1528. * ==========================
  1529. SET CONSOLE OFF
  1530. SELECT 0
  1531. USE proerror
  1532. * =======================================
  1533. * Error file is opened for use while other
  1534. * previously opened files are kept open so the
  1535. * information on what databases and indexes were
  1536. * open at the time of the error can be stored in
  1537. * the record for reference purposes.
  1538. * ========================================
  1539. APPEND BLANK
  1540. REPLACE er_no WITH xerno, er_msg WITH xmsg, ;
  1541.     kode WITH xkode, mmodul WITH xmodul, ddate ;
  1542.     WITH DATE(), ttime WITH TIME(), line_no WITH xline
  1543. SET SAFETY OFF
  1544. STORE SYS(3) + ".TXT"  TO ffile
  1545. * ======================================
  1546. * Note use of indirect referencing instead
  1547. * of the ¯o substitution
  1548. * ======================================
  1549. LIST MEMO TO (ffile)
  1550. APPEND MEMO notes FROM (ffile)
  1551. LIST STATUS TO (ffile)
  1552. APPEND MEMO notes FROM (ffile)
  1553. CLOSE DATA
  1554. ERASE (ffile)
  1555. CLEAR windows
  1556. SET CURSOR ON
  1557. CLEAR ALL
  1558. QUIT
  1559. * END Procedure Invalprn
  1560.  
  1561.  
  1562. *!*********************************************************************
  1563. *!
  1564. *!      Procedure: BADCHAIN
  1565. *!
  1566. *!      Called by: PROERROR.PRG                  
  1567. *!
  1568. *!          Calls: A_LERT         (procedure in PROERROR.PRG)
  1569. *!
  1570. *!           Uses: PROERROR.DBF   
  1571. *!               : &FFILE.DBF     
  1572. *!
  1573. *!*********************************************************************
  1574. PROCEDURE badchain
  1575. ***********************************************************************
  1576. *& Error 1012 - OS memory error.
  1577. *
  1578. *  Something has scrambled the DOS free memory chain.
  1579. *  The only solution is to return to DOS and begin all
  1580. *  over again.  Advise user & quit to DOS.
  1581. *
  1582. *    Author: Pat Adams, DB Unlimited   
  1583. *   Date: 4/28/90
  1584. *   Copyright 1990 DB Unlimited
  1585. *   All rights reserved
  1586. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1587. DEFINE WINDOW bugbox FROM 5,15 TO 17,61 PANEL SHADOW ;
  1588.     COLOR W+/N,N/W,R+*/R 
  1589. ACTIVATE WINDOW bugbox
  1590. SET COLOR TO *+R/N
  1591. @ 1,13 SAY "  BAD NEWS  "
  1592. SET COLOR TO +W/N
  1593. @ 3, 2 SAY "Something has scrambled your DOS memory."
  1594. @ 4, 2 SAY "The only solution is to return to DOS and"
  1595. @ 5, 2 SAY "start all over again."
  1596. @ 7, 2 SAY "Please call Pat Adams at DB Unlimited"
  1597. @ 8, 2 SAY "(718-469-XXXX) to report this problem."
  1598. SET COLOR TO W/N
  1599. CLEAR TYPEAHEAD
  1600. @10, 2 SAY "Press any key to return to DOS..."
  1601. DO a_lert
  1602. = INKEY(0, "M")
  1603. DEACTIVATE WINDOW bugbox
  1604. RELEASE WINDOW bugbox
  1605. CLEAR
  1606. * ==========================
  1607. *$ Store info to error file
  1608. * ==========================
  1609. SET CONSOLE OFF
  1610. SELECT 0
  1611. USE proerror
  1612. * =======================================
  1613. * Error file is opened for use while other
  1614. * previously opened files are kept open so the
  1615. * information on what databases and indexes were
  1616. * open at the time of the error can be stored in
  1617. * the record for reference purposes.
  1618. * ========================================
  1619. APPEND BLANK
  1620. REPLACE er_no WITH xerno, er_msg WITH xmsg, ;
  1621.     kode WITH xkode, mmodul WITH xmodul, ddate ;
  1622.     WITH DATE(), ttime WITH TIME(), line_no WITH xline
  1623. SET SAFETY OFF
  1624. STORE SYS(3) + ".TXT"  TO ffile
  1625. * ======================================
  1626. * Note use of indirect referencing instead
  1627. * of the ¯o substitution
  1628. * ======================================
  1629. LIST MEMO TO (ffile)
  1630. APPEND MEMO notes FROM (ffile)
  1631. LIST STATUS TO (ffile)
  1632. APPEND MEMO notes FROM (ffile)
  1633. CLOSE DATA
  1634. ERASE (ffile)
  1635. CLEAR windows
  1636. SET CURSOR ON
  1637. CLEAR ALL
  1638. QUIT
  1639. * END Procedure Badchain
  1640.  
  1641.  
  1642.  
  1643. *!*********************************************************************
  1644. *!
  1645. *!      Procedure: NOSPACE
  1646. *!
  1647. *!      Called by: PROERROR.PRG                  
  1648. *!
  1649. *!          Calls: A_LERT         (procedure in PROERROR.PRG)
  1650. *!
  1651. *!*********************************************************************
  1652. PROCEDURE nospace
  1653. ***********************************************************************
  1654. *& Error 56 - Out of disk
  1655. *
  1656. *  No more space on the disk to complete the current WRITE.
  1657. *  Frequently occurs during PACK, SORT and REINDEX commands
  1658. *  as well as when copying files to a floppy disk.
  1659. *
  1660. *  Since there may not be disk space available to save
  1661. *  information on what line of code in which module
  1662. *  generated the error the user is asked to make a screen
  1663. *  print before returning to DOS.
  1664. *
  1665. *    Author: Pat Adams, DB Unlimited    (718) 469-XXXX
  1666. *   Date: 4/28/90
  1667. *   Copyright 1990 DB Unlimited
  1668. *   All rights reserved
  1669. *
  1670. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1671. *
  1672. DEFINE WINDOW bugbox FROM 2,11 TO 20,68 PANEL SHADOW ;
  1673.     COLOR W+/N,N/W,R+*/R 
  1674. ACTIVATE WINDOW bugbox
  1675. SET COLOR TO *+R/N
  1676. @ 1,19 SAY "  BAD NEWS  "
  1677. SET COLOR TO +W/N
  1678. @ 3,11 SAY "You have run out of disk space."
  1679. @ 5, 2 SAY "It is now necessary to leave this system and return"
  1680. @ 6, 2 SAY "to DOS.  If you are not writing to a floppy disk use"
  1681. @ 7, 2 SAY "SHIFT/Print Screen to make a copy of this screen"
  1682. @ 8, 2 SAY "and call your LAN administrator."
  1683. @10, 2 SAY "ERROR #: 56   Out of Disk"
  1684. @11, 2 SAY "CODE: " + IIF(LEN(xkode) > 40, LEFT(xkode,40), xkode)
  1685. @12, 2 SAY "MODULE: " + xmodul
  1686. @13, 2 SAY "LINE #: " + STR(xline, 6,0)
  1687. SET COLOR TO W/N
  1688. CLEAR TYPEAHEAD
  1689. DO a_lert
  1690. @16,10 SAY "Press any key to return to DOS..."
  1691. = INKEY(0, "M")
  1692. * =================================================
  1693. * A CLOSE DATA or CLEAR ALL may not work
  1694. * in view of the error message.  Therefore,
  1695. * the QUIT is issued without the other commands.
  1696. *
  1697. * Depending upon a number of variables, even the
  1698. * QUIT may not unload FoxPro and take you back to DOS.
  1699. * =================================================
  1700. SET CURSOR ON
  1701. QUIT
  1702. * END Procedure Nospace
  1703.  
  1704.  
  1705.  
  1706. *!*********************************************************************
  1707. *!
  1708. *!      Procedure: NOTREADY
  1709. *!
  1710. *!      Called by: PROERROR.PRG                  
  1711. *!
  1712. *!          Calls: A_LERT         (procedure in PROERROR.PRG)
  1713. *!
  1714. *!*********************************************************************
  1715. PROCEDURE notready
  1716. ***********************************************************************
  1717. *& Error 125 - Printer not ready
  1718. *  Advise user & provide option to reset printer & retry.
  1719. *
  1720. *    Author: Pat Adams, DB Unlimited   
  1721. *   Date: 4/28/90
  1722. *   Copyright 1990 DB Unlimited
  1723. *   All rights reserved
  1724. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1725. PARAMETERS rretry
  1726. DEFINE WINDOW bugbox FROM 3,17 TO 19,63 PANEL SHADOW ;
  1727.     COLOR W+/N,N/W,R+*/R 
  1728. SET CURSOR OFF
  1729. ACTIVATE WINDOW bugbox
  1730. SET COLOR TO *+R/N
  1731. @ 1,14 SAY CHR(4)+" "+CHR(4)+"  WHOOPS  "+CHR(4)+" "+CHR(4)
  1732. SET COLOR TO +W/N
  1733. @ 3, 2 SAY "There is a problem with your printer."
  1734. @ 4, 2 SAY "Check the following:"
  1735. @ 6, 6 SAY "1.  Is the printer turned on?"
  1736. @ 8, 6 SAY "2.  Is the printer on line?"
  1737. @10, 2 SAY "Otherwise you may have a loose connection"
  1738. @11, 2 SAY "between the computer and the printer or"
  1739. @12, 2 SAY "the printer may be timing out."
  1740. SET COLOR TO +GR/N
  1741. CLEAR TYPEAHEAD
  1742. * =========================
  1743. *$ Sound long, loud siren
  1744. * =========================
  1745. DO a_lert
  1746. @14, 2 SAY "Would you like to retry printing?  (Y/N)"
  1747. * ====================================
  1748. * Error trapping for user Y/N response
  1749. * ====================================
  1750. DO yes_no WITH rretry
  1751. DEACTIVATE WINDOW bugbox
  1752. RELEASE WINDOW bugbox
  1753. RETURN rretry
  1754. * END Procedure Notready
  1755.  
  1756.  
  1757. *!*********************************************************************
  1758. *!
  1759. *!      Procedure: LOWFILES
  1760. *!
  1761. *!      Called by: PROERROR.PRG                  
  1762. *!
  1763. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1764. *!
  1765. *!           Uses: PROERROR.DBF   
  1766. *!               : &FFILE.DBF     
  1767. *!
  1768. *!*********************************************************************
  1769. PROCEDURE lowfiles
  1770. ***********************************************************************
  1771. *& Error 6 - Too many files open
  1772. *
  1773. *    This normally occurs when the FILES= statement in the
  1774. *   CONFIG.SYS has been set too low.  Advise user & return
  1775. *   to DOS.  It is also possible that the LAN software uses
  1776. *   a FILES setting of its own and that needs to be adjusted
  1777. *   upwards.
  1778. *
  1779. *    Author: Pat Adams, DB Unlimited 
  1780. *   Date: 4/28/90
  1781. *   Revised: 5/11/90
  1782. *   Copyright 1990 DB Unlimited
  1783. *   All rights reserved
  1784. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1785. PARAMETERS xerno, xmsg, xkode, xmodul, xline
  1786. DEFINE WINDOW bugbox FROM 3,17 TO 19,62 PANEL SHADOW ;
  1787.     COLOR W+/N,N/W,R+*/R 
  1788. ACTIVATE WINDOW bugbox
  1789. SET COLOR TO *+R/N
  1790. @ 1,13 SAY CHR(4)+" "+CHR(4)+"  WHOOPS  "+CHR(4)+" "+CHR(4)
  1791. SET COLOR TO +W/N
  1792. @ 3, 2 SAY "The FILES= statement in your CONFIG.SYS"
  1793. @ 4, 2 SAY "needs to be adjusted upwards.  This must"
  1794. @ 5, 2 SAY "be done from DOS.  After leaving this"
  1795. @ 6, 2 SAY "system correct the statement in your"
  1796. @ 7, 2 SAY "CONFIG.SYS to FILES=99."
  1797. @ 9, 2 SAY "If you don't know how to do this please"
  1798. @10, 2 SAY "call Pat Adams at DB Unlimited (718-"
  1799. @11, 2 SAY "469-XXXX)."
  1800. SET COLOR TO W/N
  1801. CLEAR TYPEAHEAD
  1802. DO razberry
  1803. @13, 2 SAY "Press any key to return to DOS..."
  1804. = INKEY(0, "M")
  1805. DEACTIVATE WINDOW bugbox
  1806. RELEASE WINDOW bugbox
  1807. * ==========================
  1808. *$ Store info to error file
  1809. * ==========================
  1810. SET CONSOLE OFF
  1811. SELECT 0
  1812. USE proerror
  1813. * =======================================
  1814. * Error file is opened for use while other
  1815. * previously opened files are kept open so the
  1816. * information on what databases and indexes were
  1817. * open at the time of the error can be stored in
  1818. * the record for reference purposes.
  1819. * ========================================
  1820. APPEND BLANK
  1821. REPLACE er_no WITH xerno, er_msg WITH xmsg, ;
  1822.     kode WITH xkode, mmodul WITH xmodul, ddate ;
  1823.     WITH DATE(), ttime WITH TIME(), line_no WITH xline
  1824. SET SAFETY OFF
  1825. STORE SYS(3) + ".TXT" TO ffile
  1826. * ======================================
  1827. * Note use of indirect referencing instead
  1828. * of the ¯o substitution
  1829. * ======================================
  1830. LIST MEMO TO (ffile)
  1831. APPEND MEMO notes FROM (ffile)
  1832. LIST STATUS TO (ffile)
  1833. APPEND MEMO notes FROM (ffile)
  1834. CLOSE DATA
  1835. ERASE (ffile)
  1836. CLEAR ALL
  1837. SET CURSOR ON
  1838. QUIT
  1839. * End procedure Lowfiles
  1840.  
  1841.  
  1842. *!*********************************************************************
  1843. *!
  1844. *!      Procedure: WORKSPAC
  1845. *!
  1846. *!      Called by: PROERROR.PRG                  
  1847. *!
  1848. *!          Calls: RAZBERRY       (procedure in PROERROR.PRG)
  1849. *!
  1850. *!*********************************************************************
  1851. PROCEDURE workspac
  1852. ***********************************************************************
  1853. *& Error 1410 - Unable to create temporary work files
  1854. *
  1855. *    This error will normally arise from one of two reasons:
  1856. *
  1857. *        a.  Disk or subdirectory is full
  1858. *
  1859. *        b.  The disk/subdirectory specified in the
  1860. *            CONFIG.FP for the temporary work files
  1861. *            PROGWORK, EDITWORK, and SORTWORK are not
  1862. *            available.
  1863. *
  1864. *    On a LAN the problem may also be that the user does not have
  1865. *   write "rights" in the subdirectory to which the temporary
  1866. *   work files are defaulting.
  1867. *
  1868. *    Since disk space may not be available to store information that
  1869. *    generated the error, user is requested to make a screen print
  1870. *    to save the error messages.
  1871. *
  1872. *    Author: Pat Adams, DB Unlimited   
  1873. *   Date: 4/28/90
  1874. *   Revised: 5/11/90
  1875. *   Copyright 1990 DB Unlimited
  1876. *   All rights reserved
  1877. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1878. *
  1879. DEFINE WINDOW bugbox FROM 3,17 TO 19,63 PANEL SHADOW ;
  1880.     COLOR W+/N,N/W,R+*/R
  1881. ACTIVATE WINDOW bugbox
  1882. SET COLOR TO *+R/N
  1883. @ 1,13 SAY CHR(4)+" "+CHR(4)+"  BAD NEWS  "+CHR(4)+" "+CHR(4)
  1884. SET COLOR TO +W/N
  1885. @ 3, 2 SAY "It is not possible to create the temporary"
  1886. @ 4, 2 SAY "work files needed.  Your disk or sub-"
  1887. @ 5, 2 SAY "directory may be full or the subdirectory"
  1888. @ 6, 2 SAY "specified for the temporary files may not"
  1889. @ 7, 2 SAY "exist."
  1890. @ 9, 2 SAY "If necessary, call your LAN administrator"
  1891. @10, 2 SAY "but first use SHIFT/Print Screen to make"
  1892. @11, 2 SAY "a copy of this screen."
  1893. SET COLOR TO W/N
  1894. CLEAR TYPEAHEAD
  1895. DO razberry
  1896. @13, 2 SAY "Press any key to return to DOS..."
  1897. = INKEY(0, "M")
  1898. SET CURSOR ON
  1899. CLEAR ALL
  1900. SET CURSOR ON
  1901. QUIT
  1902. * END Procedure Workspac
  1903.  
  1904.  
  1905. ***********************************************************
  1906. PROCEDURE yes_no
  1907. ***********************************************************
  1908. *& Get user Y/N input and return appropriate value
  1909. *
  1910. *    Author: Pat Adams, DB Unlimited
  1911. *   Date: 12/3/90
  1912. *   Copyright 1990 DB Unlimited
  1913. *
  1914. *    The passed parameter, USER_INPUT, is returned as
  1915. *   either a .T. or .F. value
  1916. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1917. PARAMETERS user_input
  1918. * =================================
  1919. * Error Trapping for Yes/No Response 
  1920. * with RETURN TO MASTER activated via ESC key
  1921. * =================================
  1922. PRIVATE kkey
  1923. STORE 0 TO kkey
  1924.  
  1925. DO WHILE kkey = 0
  1926.     kkey = INKEY()
  1927.  
  1928.     IF kkey = 27
  1929.         RETURN TO MASTER
  1930.     ENDIF kkey = 27
  1931.  
  1932.     IF kkey > 0
  1933.     * =============================
  1934.     * Function keys 2 thru 9 return
  1935.     * negative values.  This sets up
  1936.     * error trapping for that condition.
  1937.     * =============================
  1938.         IF CHR(kkey) $ "YyNn"
  1939.             IF CHR(kkey) $ "Yy"
  1940.                 STORE .T. TO user_input
  1941.             ELSE
  1942.                 STORE .F. TO user_input
  1943.             ENDIF chr(kkey) $ "Yy"
  1944.         ELSE
  1945.             STORE 0 to kkey
  1946.         ENDIF chr(kkey) $
  1947.     ELSE
  1948.         STORE 0 TO kkey
  1949.     ENDIF kkey > 0
  1950. ENDDO while kkey = 0
  1951.  
  1952. RETURN user_input
  1953. * END Procedure YES_NO
  1954. ** EOF: PROERROR.PRG