home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / DMSERROR.ZIP / OOPSDEMO.PRG < prev    next >
Encoding:
Text File  |  1988-09-12  |  6.7 KB  |  176 lines

  1. *--- Header ---------------------------------------------------------------
  2. *    Procedure OOPSDEMO.PRG
  3. *    Date .... August 18, 1988
  4. *    Author .. Bob Laszko, Data Management Systems
  5. *    Desc .... Demonstration code for DMSOOPS.PRG
  6. *    Notice .. Copyright 1988, Data Management Systems. All Rights Reserved
  7. *--------------------------------------------------------------------------
  8. *
  9. *--- Updates --------------------------------------------------------------
  10. *    09/09/88  Modified to work with updated DMSOOPS.PRG of 09/09/88
  11. *--------------------------------------------------------------------------
  12.  
  13. * Setup colors
  14. C_FRAME = IF(ISCOLOR(),"BG/ ","W/ ")      && cyan on black or white on black
  15. C_HEADER = IF(ISCOLOR(),"R/ ","W+/ ")     && red on black or hi white on black
  16. C_DEFAULT = IF(ISCOLOR(),"R+/ ,W+/BG,,,B/BG","W/ ")    && standard = hi red on black or white on black
  17.                                                        && enhanced = hi white on cyan or white on black
  18.                                                        && unselected = blue on cyan or white on black
  19. CLEAR
  20.  
  21. SET COLOR TO (C_FRAME)
  22. @ 01,00 SAY "╔══════════════════════════════════════════════════════════════════════════════╗"
  23. @ 02,00 SAY "║                                                                              ║"
  24. @ 03,00 SAY "╠══════════════════════════════════════════════════════════════════════════════╣"
  25. @ 04,00 SAY "║                                                                              ║"
  26. @ 05,00 SAY "║                                                                              ║"
  27. @ 06,00 SAY "║                                                                              ║"
  28. @ 07,00 SAY "║                                                                              ║"
  29. @ 08,00 SAY "║                                                                              ║"
  30. @ 09,00 SAY "║                                                                              ║"
  31. @ 10,00 SAY "║                                                                              ║"
  32. @ 11,00 SAY "║                                                                              ║"
  33. @ 12,00 SAY "║                                                                              ║"
  34. @ 13,00 SAY "║                                                                              ║"
  35. @ 14,00 SAY "║                                                                              ║"
  36. @ 15,00 SAY "║                                                                              ║"
  37. @ 16,00 SAY "║                                                                              ║"
  38. @ 17,00 SAY "║                                                                              ║"
  39. @ 18,00 SAY "║                                                                              ║"
  40. @ 19,00 SAY "║                                                                              ║"
  41. @ 20,00 SAY "║                                                                              ║"
  42. @ 21,00 SAY "║                                                                              ║"
  43. @ 22,00 SAY "╠══════════════════════════════════════════════════════════════════════════════╣"
  44. @ 23,00 SAY "║                                                                              ║"
  45. @ 24,00 SAY "╚══════════════════════════════════════════════════════════════════════════════╝"
  46.  
  47. SET COLOR TO (C_HEADER)
  48. @ 02,02 SAY "OOPSDEMO.PRG - Copyright 1988 Data Managment Systems"
  49. SET COLOR TO (C_DEFAULT)
  50.  
  51.  
  52.  
  53. * OOPS.PRG example #1
  54. *
  55. DECLARE OOPS_MSG[2]
  56. OOPS_MSG[1] = "Printer is not ready. Make sure"
  57. OOPS_MSG[2] = "it is on-line and has paper"
  58.  
  59. DECLARE OOPS_RESP[2]
  60. OOPS_RESP[1] = "R"
  61. OOPS_RESP[2] = "A"
  62.  
  63. OOPS_ACTION = SPACE(1)
  64.  
  65. DO DMSOOPS WITH "Printer Not Ready", 1,"R = Retry   A = Abort", "UL", .T., .T., .T., .T.,"▒", "R"
  66.  
  67. RELEASE OOPS_MSG, OOPS_RESP
  68.  
  69. * - or -
  70.  
  71. DECLARE OOPS_MSG[2]
  72. OOPS_MSG[1] = "Printer is not ready. Make sure"
  73. OOPS_MSG[2] = "it is on-line and has paper"
  74.  
  75. DECLARE OOPS_RESP[2]
  76.  
  77. OOPS_RESP[1] = "R"
  78. OOPS_RESP[2] = "A"
  79.  
  80. OOPS_ACTION = SPACE(1)
  81.  
  82. title = "Printer Not Ready"
  83. frame = 1
  84. instruction = "R = Retry   A = Abort"
  85. location = "UR"
  86. rest_scrn = .T.
  87. explode = .T.
  88. implode = .T.
  89. shad_show = .T.
  90. shad_char = "▒"
  91. shad_side = "R"
  92.  
  93. DO DMSOOPS
  94.  
  95. RELEASE OOPS_MSG, OOPS_RESP, title, frame, instruction
  96. RELEASE location, rest_scrn, explode, implode, shad_show
  97. RELEASE shad_char, shad_side
  98.  
  99. * - either results in:
  100.  
  101. *                  ┌──────[ Printer Not Ready ]──────┐
  102. *                  │                                 │▒▒
  103. *                  │ Printer is not ready. Make sure │▒▒
  104. *                  │ it is on-line and has paper     │▒▒
  105. *                  │                                 │▒▒
  106. *                  └────[ R = Retry   A = Abort ]────┘▒▒
  107. *                   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  108.  
  109.  
  110. * OOPS.PRG example #2
  111. *
  112. DECLARE OOPS_MSG[2]
  113. OOPS_MSG[1] = "Customer John Smith"
  114. OOPS_MSG[2] = "does not exist."
  115.  
  116. DECLARE OOPS_RESP[2]
  117. OOPS_RESP[1] = "Y"
  118. OOPS_RESP[2] = "N"
  119.  
  120. OOPS_ACTION = SPACE(1)
  121.  
  122. instruction = "Add ?  Y = Yes   N = No"
  123. location = "LL"
  124. shad_show = .F.
  125.  
  126. DO DMSOOPS
  127.  
  128. RELEASE OOPS_MSG, OOPS_RESP, instruction, location, shad_show
  129.  
  130. * - results in:
  131. *
  132. *                  ┌───────────[ OOPS ]──────────┐
  133. *                  │                             │
  134. *                  │     Customer John Smith     │
  135. *                  │     does not exist          │
  136. *                  │                             │
  137. *                  └─[ Add ?  Y = Yes   N = No ]─┘
  138.  
  139.  
  140. * OOPS.PRG example #3
  141. *
  142. DECLARE OOPS_MSG[2]
  143. OOPS_MSG[1] = "This customer has sales"
  144. OOPS_MSG[2] = "Cannot delete at this time"
  145.  
  146. DO DMSOOPS
  147.  
  148. RELEASE OOPS_MSG
  149.  
  150. * - results in:
  151. *
  152. *                  ┌───────────[ OOPS ]──────────┐
  153. *                  │                             │▒▒
  154. *                  │ This customer has sales     │▒▒
  155. *                  │ Cannot delete at this time  │▒▒
  156. *                  │                             │▒▒
  157. *                  └[ Press Any Key to Continue ]┘▒▒
  158. *                   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  159.  
  160.  
  161. SET COLOR TO (C_FRAME)
  162. CLEAR
  163.  
  164. @ 01,01 SAY "Please send any comments, suggestions, or gripes to:"
  165. @ 03,01 SAY "Bob Laszko                    BBS - The File Bank"
  166. @ 04,01 SAY "Data Management Systems             Clipper Support Conference"
  167. @ 05,01 SAY "PO Box 3104                         Fallbrook, Ca"
  168. @ 06,01 SAY "Fallbrook, Ca  92028                (619) 728-4318"
  169. @ 07,01 SAY "(619) 728-0984"
  170. @ 09,01
  171.  
  172. QUIT
  173.  
  174. *--------------------------------------------------------------------------
  175. *    EOP  OOPSDEMO.PRG
  176. *--------------------------------------------------------------------------