home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a079 / 1.img / FPDG.LZH / VOL2NUM0 / MISC / ONSAVE.PRG < prev    next >
Encoding:
Text File  |  1993-02-01  |  1.5 KB  |  48 lines

  1. *****************************************************************
  2. *     * 09/92               ONSAVE.PRG                          *
  3. *****************************************************************
  4. *     * Author's Name: Jeb Long                                 *
  5. *     *                                                         *
  6. *     * Description:                                            *
  7. *     * This program illustrates the use of ON() function       *
  8. *     * to retrive ON command commands.                         *
  9. *****************************************************************
  10. ON ERROR DO ERRPROC WITH 1
  11. ON KEY LABEL CTRL+F2 DO THING1
  12. *
  13. *  ... Do some processing
  14. *
  15. ON KEY LABEL CTRL+F2 DO THING2
  16. *
  17. *  ... Do some more processing
  18. *
  19. ON KEY LABEL CTRL+F3 DO THING3
  20. *
  21. * ... Do even more processing
  22. *
  23. WAIT WINDOW 
  24. ON KEY LABEL CTRL+F2
  25. ON ERROR
  26. RETURN
  27. ***********************************************************
  28. * ERRPROC - Performs error recovery operations
  29. *
  30. PROCEDURE ERRPROC
  31. PARAMETER ErrLoc
  32. SaveONerr  = ON("ERROR")  && Save the ON ERROR action
  33. SaveCtrlF2 = ON ("KEY", "CTRL+F2") 
  34. ON KEY LABEL CTRL+F2
  35. ON ERROR DO ERR2  && Do another error procedure
  36. *
  37. *  ... Do error recovery operation
  38. *
  39. ON ERROR &SaveONerr      && Reestablish original ON action
  40. ON KEY LABEL CTRL+F2 &SaveCtrlF2  
  41. RETURN
  42. *************************************************************
  43. * ERR2 - Secondary error recovery program
  44. *
  45. PROCEDURE ERR2
  46. *   ... Process error that occurs in ERRPROC
  47. RETURN
  48.