home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CLIPB52.ZIP / SCHWARTZ.ZIP / DUMPERRS.PRG < prev    next >
Encoding:
Text File  |  1990-06-06  |  1.9 KB  |  67 lines

  1. /*********************************************************************
  2. *
  3. * Name:        DUMPERRS.prg
  4. * Description:  Utility to dump the ERRORLOG.dbf and TRACE.dbf files
  5. *               created by the MYERR.prg Error System routine
  6. * Author:    Philip H. Schwartz
  7. * Audience:    Nantucket DEVCON '90
  8. * Written:      June 6, 1990
  9. * Compiler:    Clipper 5.0 V7.7 BETA
  10. * Comp Option:
  11. * Linker:       RTLink Version 1.3 (Clipper)
  12. * Library:    clipper, extend
  13. * Obj Module:   
  14. * Link input:   rtlink fi dumperrs out dumperrs li clipper,extend 
  15. * Headers:    STD.ch
  16. * Copyright:    (c) 1990 Philip H. Schwartz
  17. * Rights:    All Commercial & Publishing Rights Reserved
  18. *
  19. *********************************************************************/
  20.  
  21. CLS
  22.  
  23. /* Check for presence of ERRORLOG.dbf and TRACE.dbf.  Quit
  24.    if not there.                                            */
  25.  IF !FILE('errorlog.dbf') .OR. !FILE('trace.dbf')
  26.   ? "ErrorLog.dbf and/or Trace.dbf are MISSING."
  27. ENDIF
  28.  
  29. /* Open ERRORLOG.dbf in a new select area and INDEX on ID field */
  30. USE errorlog NEW
  31. IF LASTREC()=0
  32.   ? "ErrorLog is EMPTY."
  33.   USE
  34.   RETURN
  35. ENDIF
  36. INDEX ON errnum TO errorlog
  37.  
  38. /* Open TRACE.dbf in a new select area and INDEX on ID field */
  39. USE trace NEW
  40. INDEX ON errnum TO trace
  41.  
  42. SELECT errorlog
  43.  
  44. DO WHILE .NOT. EOF()
  45.   CLS
  46.   IF errnum>0
  47.     ? STR(errnum,14)+"  "+DTOC(termdate)+"  "+termtime+"  "+;
  48.      trim(procname)+"["+LTRIM(STR(procline,8))+"]"
  49.     ? "VERS="+STR(version,7,2)+"  EXE LEVEL="+STR(exelevel,7,3)+;
  50.      "    MEMORY: (T="+STR(memtot,4)+"K,  B="+STR(memblock,4)+;
  51.       "K,  R="+STR(memrun,4)+"K)"
  52.     ? "MSG->:"+text
  53.     SELECT trace
  54.     SEEK errorlog->errnum
  55.     DO WHILE errorlog->errnum=trace->errnum
  56.       ? SPACE(3)+"Called from "+procname+'['+LTRIM(STR(procline,8))+']'
  57.       SKIP
  58.     ENDDO
  59.     SELECT errorlog
  60.     INKEY(0)
  61.   ENDIF
  62.   SKIP
  63. ENDDO
  64. CLOSE DATABASES
  65. RETURN
  66. /*EOF*/
  67.