home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a070 / 3.ddi / FOXPRO / SAMPLE / SYSERROR.PRG < prev    next >
Encoding:
Text File  |  1990-04-07  |  2.1 KB  |  63 lines

  1. * ┌─────────────────────────────────────────────────────────────────────┐ *
  2. * │  PROG NAME: SYSERROR.PRG                                            │ *
  3. * │  Copyright (c) 1989,1990 Tech III, Inc. All rights reserved.        │ *
  4. * │  Tech III of San Pedro, California      (213) 547-2191.             │ *
  5. * │  "The bridge connecting people and technology."(tm)                 │ *
  6. * └─────────────────────────────────────────────────────────────────────┘ *
  7. parameters PROGNAME, ERR_LINE
  8. private PROGNAME, ERR_LINE
  9. on error
  10. define window SYSERROR from 05,01 to 16,78 float grow zoom close color scheme 7
  11. activate window SYSERROR
  12. set device to screen
  13. set console on
  14. set printer off
  15. clear gets
  16. store 'Retry   ' to NEXTSTEP
  17. set bell on
  18. ?? chr(07)
  19. ?? chr(07)
  20. ?? chr(07)
  21. set bell off
  22. @ 00,01 say '                A PROGRAM ERROR HAS BEEN ENCOUNTERED!'
  23. @ 02,01 say '  ERROR NUMBER: ' + ltrim(str(error(),5))
  24. @ 03,01 say ' ERROR MESSAGE: ' + left(message(),75)
  25. @ 04,01 say 'EXECUTING LINE: ' + ltrim(str(ERR_LINE,5))
  26. @ 05,01 say '    ERROR LINE: ' + ltrim(message(1))
  27. @ 06,01 say '    IN PROGRAM: ' + PROGNAME
  28. @ 08,01 say 'Retry / Continue / Suspend / Edit / Cancel / Quit ?: ' get NEXTSTEP ;
  29. picture '@M Retry   ,Continue,Suspend ,Edit    ,Cancel  ,Quit    '
  30. read
  31. do case
  32.   case NEXTSTEP = 'Retry'
  33.     release window SYSERROR
  34.     retry
  35.   case NEXTSTEP = 'Continue'
  36.     release window SYSERROR
  37.   case NEXTSTEP = 'Suspend'
  38.     release window SYSERROR
  39.     on error
  40.     suspend
  41.   case NEXTSTEP = 'Edit'
  42.     release window SYSERROR
  43.     if .not. file(PROGNAME+ '.prg')
  44.       do STANDBY with 'This system seems to think the program is: ' + PROGNAME
  45.       modify command
  46.     else
  47.       modify command (PROGNAME+ '.prg')
  48.     endif
  49.   case NEXTSTEP = 'Cancel'
  50.     deactivate window SYSERROR
  51.     store .F. to IN_SYSTEM
  52.     release window SYSERROR
  53.     deactivate menu 
  54.   case NEXTSTEP = 'Quit'
  55.     release window SYSERROR
  56.     quit
  57.   otherwise
  58.     release window SYSERROR
  59. endcase
  60. store 'SYSERROR' to ERR_RTN
  61. on error do &ERR_RTN with program(), lineno()
  62. return
  63.