home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / DATABASE / ANSI_SUB.ZIP / VANSI.SUB
Encoding:
Text File  |  1991-01-18  |  5.4 KB  |  130 lines

  1. $Screen
  2. Remarks
  3. ────────────────────────────────────────────────────────────────────────────
  4.     Note- by declaring this a SCREEN I can add comments to the top of this
  5. subroutine.  That is the only purpose of this "Screen"
  6. ────────────────────────────────────────────────────────────────────────────
  7.     My apologies to whomever wrote this up in the Microrim exchange
  8. sometime in the middle of 1990 (or was it 1989?).  They deserve the credit;
  9. -->  What I've discovered is that these routines will compile very well.
  10. -->  These may also be used as a CUSTOM in applications express!
  11. ────────────────────────────────────────────────────────────────────────────
  12. HELPSET initializes the [f1] key as an additional HELP key.  The [f10] is
  13.    inaffected, and will ALSO work as the HELP key for users with that
  14.    keystroke memorized.
  15. HELPEND tidies up when you exit your routine.
  16. ────────────────────────────────────────────────────────────────────────────
  17. There are 3 additional routines:
  18.    Arrows    - redefines up- and down-arrow keys
  19.    ArrowESC  - redefines up- and down-arrow keys AND the Enter key
  20.    EndArrow  - returns all keys to their origional use
  21. ────────────────────────────────────────────────────────────────────────────
  22. Sample use with a TIERed form:
  23.    Run Arrows in vANSI.SUB
  24.    EDIT using (formname)
  25.    Run EndArrow in vANSI.SUB
  26. ────────────────────────────────────────────────────────────────────────────
  27.                            DYNAMIC MENUING
  28. Sample use with a TIERed form used like a menu:
  29.       Run ArrowESC in vANSI.SUB
  30.       EDIT using (formname)
  31.       Run EndArrow in vANSI.SUB
  32. I call this technique "Dynamic Menuing", and is marvelous!
  33. It replaces this technique:
  34.          "out filespec"
  35.          "sel column from table"
  36.          "out screen"
  37.          "Choose var from filespec"
  38. and overcomes the built-in size limitations with the choose command.
  39. ────────────────────────────────────────────────────────────────────────────
  40. $Command
  41. HelpSet
  42. *(┌─────────────────────────────────────────────────────────────┐)
  43. *(│ This reassigns HELP in RBase 2.11 - THIS WILL COMPILE!      │)
  44. *(│ Change [f1] key to work like [f10].                         │)
  45. *(│ 0;59 = [F1]             0;68 = [f10]                        │)
  46. *(└─────────────────────────────────────────────────────────────┘)
  47. Output CON
  48. Set   Variable vANSI TEXT
  49. Set   Variable vANSI to (CHAR(27)+ "[0;59;0;68p")
  50. Show  Variable vANSI at 8 5
  51. Clear vANSI
  52. Output Screen
  53. RETURN
  54. $Command
  55. HelpEnd
  56. *(┌─────────────────────────────────────────────────────────────┐)
  57. *(│ Return REDFINED keys back to their origional function.      │)
  58. *(│ Uhhh..  "Zero out [HELP] key."                              │)
  59. *(└─────────────────────────────────────────────────────────────┘)
  60. Output CON
  61. Set   Variable vANSI TEXT
  62. Set   Variable vANSI to (CHAR(27)+ "[0;59;0;59p")
  63. Show  Variable vANSI at 8 5
  64. Clear vANSI
  65. Output Screen
  66. Return
  67. $Command
  68. Arrows
  69. *(╔═════════════════════════════════════════════════════════════╗)
  70. *(║ Change the Arrow keys to work like [F8] and [F7].           ║)
  71. *(║ The ENTER key is unaffected.                                ║)
  72. *(║ These will be used in a form with tiers.                    ║)
  73. *(╚═════════════════════════════════════════════════════════════╝)
  74. *(╔═════════════════════════════════════════════════════════════╗)
  75. *(║ 0;72 = Up Arrow         0;65 = [f7]                         ║)
  76. *(║ 0;80 = Down Arrow       0;66 = [f8]                         ║)
  77. *(║    To reassign keys, use this format: (oldkey);(newkey);p   ║)
  78. *(╚═════════════════════════════════════════════════════════════╝)
  79. Output con
  80. Set   Variable vANSI TEXT
  81. Set   Variable vANSI to (CHAR(27)+ "[0;72;0;65p")
  82. Show  Variable vANSI at 8 5
  83. Set   Variable vANSI to (CHAR(27)+ "[0;80;0;66p")
  84. Show  Variable vANSI at 8 5
  85. Clear vANSI
  86. Output Screen
  87. Return
  88. $Command
  89. ArrowEsc
  90. *(╔═════════════════════════════════════════════════════════════╗)
  91. *(║ Change the Arrow keys to work like [F8] and [F7].           ║)
  92. *(║ The ENTER key is redefined to be the [ESC] key.             ║)
  93. *(║ These will be used in a form with tiers.                    ║)
  94. *(╚═════════════════════════════════════════════════════════════╝)
  95. *(╔═════════════════════════════════════════════════════════════╗)
  96. *(║ 0;72 = Up Arrow         0;65 = [f7]                         ║)
  97. *(║ 0;80 = Down Arrow       0;66 = [f8]                         ║)
  98. *(║   27 = [Esc]              13 = [Return]                     ║)
  99. *(║    To reassign keys, use this format: (oldkey);(newkey);p   ║)
  100. *(╚═════════════════════════════════════════════════════════════╝)
  101. Output con
  102. Set   Variable vANSI TEXT
  103. Set   Variable vANSI to (CHAR(27)+ "[0;72;0;65p")
  104. Show  Variable vANSI at 8 5
  105. Set   Variable vANSI to (CHAR(27)+ "[0;80;0;66p")
  106. Show  Variable vANSI at 8 5
  107. Set   Variable vANSI to (CHAR(27)+ "[13;27p")
  108. Show  Variable vANSI at 8 5
  109. Clear vANSI
  110. Output Screen
  111. Return
  112. $Command
  113. EndArrow
  114. *(╔═════════════════════════════════════════════════════════════╗)
  115. *(║ Return REDFINED keys back to their origional function.      ║)
  116. *(║ Uhhh..  "Zero out arrow keys"                               ║)
  117. *(╚═════════════════════════════════════════════════════════════╝)
  118. Output con
  119. Set   Variable vANSI TEXT
  120. Set   Variable vANSI to (CHAR(27)+ "[0;72;0;72p")
  121. Show  Variable vANSI at 8 5
  122. Set   Variable vANSI to (CHAR(27)+ "[0;80;0;80p")
  123. Show  Variable vANSI at 8 5
  124. Set   Variable vANSI to (CHAR(27)+ "[13;13p")
  125. Show  Variable vANSI at 8 5
  126. Clear vANSI
  127. Output Screen
  128. CLS
  129. Return
  130.