home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a070 / 3.ddi / FOXPRO / GOODIES / SETSAVE.PRG < prev    next >
Encoding:
Text File  |  1989-11-09  |  3.1 KB  |  97 lines

  1. *:*********************************************************************
  2. *:
  3. *:        Program: SETSAVE.PRG
  4. *:
  5. *:         System: FoxPro SET Option Save/Restore Example
  6. *:         Author: Fox Software, Inc.
  7. *:      Copyright (c) 1989, Fox Software, Inc.
  8. *:  Last modified: 10/07/89     10:41
  9. *:
  10. *:            Notes:    This routine illustrates how the values
  11. *:                    of all the FoxPro SET options can be
  12. *:                    saved in an array.  Notice the special
  13. *:                    treatment necessary for the TALK option.
  14. *:                    Program SETSET.PRG restores the original
  15. *:                    status of the system.  This is useful if
  16. *:                    you're trying to write a generally applicable
  17. *:                    UDF where it's desirable to preserve the
  18. *:                    original SET options.  Of course, you
  19. *:                    actually need to save/restore only the
  20. *:                    SET options which you change in your routine
  21. *:
  22. *:      Documented 10/07/89 at 10:44               FoxDoc  version 2.0
  23. *:*********************************************************************
  24. PUBLIC _oldsets(64)            && Array to save old values
  25. IF SET("TALK") = "ON"        && TALK has to be handled
  26.    SET TALK OFF                && as a special case.
  27.    _oldsets(57) = "ON"
  28. ELSE
  29.    _oldsets(57) = "OFF"
  30. ENDIF
  31. SET TALK OFF
  32. _oldsets(1) = SET("AUTOSAVE")
  33. _oldsets(2) = SET("BELL")
  34. _oldsets(3) = SET("BLINK")
  35. _oldsets(4) = STR(SET("BLOCKSIZE"))
  36. _oldsets(5) = SET("CARRY")
  37. _oldsets(6) = SET("CENTURY")
  38. _oldsets(7) = SET("CLEAR")
  39. _oldsets(8) = SET("CLOCK")
  40. _oldsets(9) = SET("COLOR")
  41. _oldsets(10) = SET("COMPATIBLE")
  42. _oldsets(11) = SET("CONFIRM")
  43. _oldsets(12) = SET("CONSOLE")
  44. _oldsets(13) = SET("CURRENCY")
  45. _oldsets(14) = SET("DATE")
  46. _oldsets(15) = SET("DEBUG")
  47. _oldsets(16) = STR(SET("DECIMALS"))
  48. _oldsets(17) = SET("DEFAULT")
  49. _oldsets(18) = SET("DELETED")
  50. _oldsets(19) = SET("DELIMITERS")
  51. _oldsets(20) = SET("DEVELOPMENT")
  52. _oldsets(21) = SET("DEVICE")
  53. _oldsets(22) = SET("DOHISTORY")
  54. _oldsets(23) = SET("ECHO")
  55. _oldsets(24) = SET("ESCAPE")
  56. _oldsets(25) = SET("EXACT")
  57. _oldsets(26) = SET("EXCLUSIVE")
  58. _oldsets(27) = SET("FIELDS")
  59. *    _oldsets(28) = SET("FILTER")
  60. _oldsets(29) = SET("FIXED")
  61. _oldsets(30) = SET("FULLPATH")
  62. _oldsets(31) = SET("HEADING")
  63. _oldsets(32) = SET("HELP")
  64. _oldsets(33) = SET("HISTORY")
  65. _oldsets(34) = STR(SET("HOURS"))
  66. _oldsets(35) = SET("INTENSITY")
  67. _oldsets(36) = STR(SET("MARGIN"))
  68. _oldsets(37) = SET("MARK")
  69. _oldsets(38) = STR(SET("MEMOWIDTH"))
  70. _oldsets(39) = SET("MENU")
  71. _oldsets(40) = SET("MESSAGE")
  72. _oldsets(41) = STR(SET("MOUSE",1))
  73. _oldsets(42) = SET("NEAR")
  74. _oldsets(43) = STR(SET("ODOMETER"))
  75. _oldsets(44) = SET("PATH")
  76. _oldsets(45) = SET("POINT")
  77. _oldsets(46) = SET("PRINT")
  78. _oldsets(47) = SET("RESOURCE")
  79. _oldsets(48) = SET("SAFETY")
  80. _oldsets(49) = SET("SCOREBOARD")
  81. _oldsets(50) = SET("SEPARATOR")
  82. _oldsets(51) = SET("SHADOW")
  83. _oldsets(52) = SET("SPACE")
  84. _oldsets(53) = SET("STATUS")
  85. _oldsets(54) = SET("STEP")
  86. _oldsets(55) = SET("STICKY")
  87. _oldsets(56) = SET("SYSMENUS")
  88. _oldsets(58) = SET("TITLE")
  89. _oldsets(59) = STR(SET("TYPEAHEAD"))
  90. _oldsets(60) = SET("UNIQUE")
  91. _oldsets(61) = INSMODE()
  92. _oldsets(62) = CAPSLOCK()
  93. _oldsets(63) = NUMLOCK()
  94. SET TALK &_oldsets(57)
  95. RETURN
  96. *: EOF: SETSAVE.PRG
  97.