home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / editor / vp_demo.zip / DEMO.VD2 < prev    next >
Text File  |  1992-11-30  |  8KB  |  280 lines

  1. R*
  2. R*    S U B R O U T I N E   M A C R O S
  3. R*
  4. R*  H -    "Header" macro - displays colored header
  5. R*    Enter:  R9 = text to display, Q21 = attribute to use
  6. R*
  7. RI(H)\
  8. YJN 10 0        R* No scroll bars
  9. (.wb==2 | .wt>1)[ YWI ]    R* Remove any windows and/or scroll bars
  10. Q27YEA YEC        R* Clear window
  11. .u9+10XS(0)        R* Q0 = total width of header
  12. (.wc-Q0)/2XS(1)        R* Q1 = # spaces to center header
  13.  
  14. YEN Q1YEB        R* New line and spaces to center
  15. Q21YEA            R* Switch attribute
  16. "╔:YD            R* Box-corner
  17. Q0-2["═:YD] "╗:YD    R* Box-top and box-corner
  18.  
  19. Q27YEA            R* Restore attribute
  20. YEN Q1YEB        R* New line and spaces to center
  21. Q21YEA            R* Switch attribute
  22. "║:YD            R* Box-side
  23. 4YEB            R* 4 spaces before header
  24. RD(9)            R* Actual header
  25. 4YEB            R* 4 spaces after header
  26. "║:YD            R* Box-side
  27.  
  28. Q27YEA            R* Restore attribute
  29. YEN Q1YEB        R* New line and spaces to center
  30. Q21YEA            R* Switch attribute
  31. "╚:YD            R* Box-corner
  32. Q0-2["═:YD] "╝:YD    R* Box-top and box-corner
  33.  
  34. Q27YEA            R* Restore attribute
  35. YEN            R* End current line
  36. \
  37. R*
  38. R*  K -    "Key" macro - pause for user to press any key
  39. R*
  40. RI(K)\
  41. Q23YEA
  42. YT/              --- PRESS ANY KEY TO CONTINUE --- /
  43. Q27YEA
  44. XK(0)//
  45. \
  46. R*
  47. R*  L -    "List" macro - list data files one page at a time
  48. R*    Enter:  R9 = header to display
  49. R*        R8 = filename of data file
  50. R*
  51. RI(L)\
  52. EE(7) EZY        R* Switch to temp buffer and empty it
  53. ER |R8            R* Open desired file
  54. 0A            R* Read it all in
  55.  
  56. M(H)            R* Display header using R9
  57.  
  58. [            R* Start REPEAT-UNTIL loop
  59.  
  60. 6YEV 0YEH        R* Move cursor below header
  61. YES            R* Erase to to end of window
  62.  
  63. .pXS(0)            R* Save current edit position
  64. F//            R* Search for <Ctrl-S> which ends this screen
  65. Q0,.p-1T        R* Display one screen of text (move back to Q0)
  66. F//            R* Find same <Ctrl-S> again
  67.  
  68. M(K)            R* Pause()
  69.  
  70. .eofJL            R* REPEAT-UNTIL end of file reached
  71. ]
  72.  
  73. EE(@)            R* Switch back to main buffer
  74. \
  75. R*
  76. R*  M -    "Menu" macro - displays and prompts user with menu
  77. R*    Enter:    R8 = Multi-line menu    Q8 = attribute for menu-bar
  78. R*        R9 = header to display
  79. R*                    Q12 = initial menu item to highlight (-1)
  80. R*    Return: Q12 = user's selection number
  81. R*
  82. R*    Usage:    Q1 = # spaces to center menu
  83. R*        Q3 = Count of # lines in menu
  84. R*        Q4,Q5 = Save for cursor position
  85. R*
  86. RI(M)\
  87. M(H)            R* Display header using R9
  88.             R* Return: Q1 = # spaces to center header
  89. YEN            R* Display blank line
  90. 1XA(12)            R* Skip to next menu-line
  91. EE(8)            R* Switch to editing menu-text
  92. Z            R* Goto last line+1
  93. .ln-1XS(3)        R* Q3 = # lines in menu
  94. B
  95.  
  96. Q3[            R* Loop for all lines in menu
  97.     Q1YEH        R* Horizontally position on line
  98.     T L        R* Display line and goto next line
  99. ]
  100.  
  101. YEN            R* Display blank line
  102. Q1YEH            R* Horizontally position on line
  103. Q23YEA
  104. YT/Select with Arrow keys or <Space Bar>; then press <Enter>/
  105. Q27YEA
  106. .wxXS(5) .wyXS(6)    R* Save cursor position
  107.  
  108. [
  109.  
  110. B Q12-1L        R* Position to text for menu-bar
  111. Q12+5YEV Q1YEH        R* Position cursor in window
  112. Q8YEA            R* Highlight attribute
  113. T            R* Display text
  114. Q27YEA            R* Restore attribute
  115.  
  116. !KEY!
  117.  
  118. Q5YEH Q6YEV        R* Restore cursor position
  119. XF(0)""            R* Wait for keyboard input
  120.  
  121. (Q0=="R *256+"T)[ JM ]        R* If <Return>
  122.  
  123. (.kp(0)<>32) & (Q0<>"C*256+"U) & (Q0<>"C*256+"D)[    R* If invalid key
  124.     YA JP/KEY/                    R* Get next key
  125.     ][                R* ELSE - <SPACE> or <Up> <Down>
  126.     B Q12-1L        R* Position to text for menu-bar
  127.     Q12+5YEV Q1YEH        R* Position cursor in window
  128.     T            R* Display text in normal attribute
  129.     (Q0=="C*256+"U)[
  130.         -XA(12) (Q12<1)[ Q3XS(12) ]
  131.     ][
  132.         XA(12) (Q12>Q3)[ 1XS(12) ]
  133.     ]
  134.     ]
  135. ]
  136. \
  137. R*
  138. R*  N -    Macro to display the next screen of instructions during Command
  139. R*    Mode demos.
  140. R*    Enter: Instruction text loaded into edit buffer 1.
  141. R*
  142. RI(N)\
  143. EE(1)            R* Switch to edit buffer 1
  144. @F/|L/        R* Search for next ^S
  145. (.es) [ EE(@) RJ(Z) ]    R* Return to main menu when end-of-file reached
  146. -100K B            R* Delete text preceding ^S
  147. -V            R* Display next screen
  148. EE(@)
  149. \
  150. R*
  151. R*  S -    Macro to display signon message.
  152. R*    Set Q29 = "Y/N" for scroll bars.
  153. R*
  154. RI(S)\
  155. RI(9)"Welcome to the VEDIT Family Demonstration"
  156. M(H)            R* Display header
  157.  
  158. EE(@)
  159. YT`
  160. Welcome to the demonstration/tutorial of the VEDIT Family of file editors.
  161.  
  162. The VEDIT Family of editors includes VEDIT Jr., VEDIT and VEDIT PLUS. Since
  163. these editors are upwards compatible, this demo is applicable to all three.
  164.  
  165. The demo is divided into 14 topics that you can select from a main menu. The
  166. features common to all three editors are covered first. Then the additional
  167. features in VEDIT (primarily multi-file editing, windowing and data/binary
  168. file editing) are covered. Last, the macro programming language capabilities
  169. of VEDIT PLUS are introduced.
  170.  
  171. Unlike other demonstrations which are just "slide shows", in this demo you
  172. are running a fully functional version of VEDIT PLUS. When you are done with
  173. the demo, you can use VDEMO.EXE to edit your own files. The READ-ME.BAT file
  174. describes the capabilities and restrictions of VDEMO.EXE in more detail.
  175.  
  176. Enjoy!
  177. `
  178. M(K)            R* Wait for <Enter>
  179. 5YEV 0YEH YES        R* Position cursor, clear rest of screen
  180.  
  181. YT`
  182. VEDIT Jr. has many features to make editing simple and productive:`
  183.  
  184. Q22YEA            R* White on red
  185. YT`
  186.   * Intuitive full screen editing; edit text and data/binary files of any size  
  187.   * Pull-down menus with "hot keys", on-line help and mouse support             
  188.   * Block operations by character, line, file or column; block indent/undent    
  189.   * Completely re-configurable keyboard layout; unlimited keystroke macros      
  190.   * Multi-level UNDO (up to 1000 levels) lets you quickly recover from mistakes 
  191.   * Word processing features simplify editing of documentation, reports, etc.   
  192.   * Special features for program development (C, Assembler, Pascal, PL/I etc.)  
  193. `
  194. Q27YEA
  195. YT`
  196. VEDIT has all the features above plus:`
  197. Q22YEA
  198. YT`
  199. ==> Simultaneously edit multiple files with or without windows                  
  200. ==> Multi-mode editing of data/binary files in ASCII, EBCDIC or Hexadecimal     
  201. ==> Integrated Compile/Link/Debug/Make support with automatic error tracking    
  202. `
  203. Q27YEA
  204. YT`
  205. VEDIT PLUS adds a powerful text oriented "programming language":`
  206. Q22YEA
  207. YT`
  208. ==> Eliminates repetitive editing tasks; create your own editing functions      
  209. ==> A complete application language for filters, translators and much more      
  210. ==> This demonstration is entirely written in the VEDIT PLUS macro language!    
  211. `
  212. Q27YEA
  213.  
  214. M(K)
  215. 5YEV 0YEH YES
  216.  
  217. YT`
  218. This demonstration is quite in-depth and also serves as a tutorial for new
  219. users. It is best to run through the menu from top to bottom. A quick
  220. overview will take about 15 minutes while a detailed tutorial will take about
  221. an hour. The topic marked as "Tutorial" is the most in-depth.
  222.  
  223. NOTE:       VEDIT attempts to increase your keyboard's "typematic" repeat rate.
  224.        If this interferes with your pre-programmed rate, use the "-K"
  225.        invocation option - see READ-ME.BAT.
  226.  
  227. REMEMBER:  One window always gives explanations and directions. The last line
  228.        tells you how to continue to the next "lesson". You can usually
  229.        press the <Esc> key repeatedly to quickly run through the demo.
  230.  
  231.        Or you can press <Alt-F8> to return to the main menu.
  232.  
  233. `
  234. M(K)
  235. 5YEV 0YEH YES
  236.  
  237. YT`
  238. VEDIT can display editing windows with or without scroll bars.
  239.  
  240. Advantage    Scroll bars simplify mouse operation. They show the
  241.         relative position in the file.
  242.  
  243. Disadvantage    Because of the lines/columns used by the scroll bars,
  244.         less of the file(s) can be seen at once.
  245.  
  246. Without real scroll bars, VEDIT's "stealth" scroll bars still let you
  247. perform all mouse operations.
  248.  
  249. `
  250. .wa+8YEA
  251. (.ma>0)[
  252.     YT`VEDIT has detected a mouse on your system.` YEN Q27YEA
  253.     YT`The mouse cursor is initially in the top left corner where it is invisible.
  254. The tutorial introduces mouse operation.`
  255.     ][
  256.     YT`VEDIT has not detected a mouse on your system.`
  257.     ]
  258. 2YEN
  259. Q23YEA
  260. YT"Do you want to use scroll bars in this demonstration? [Y]es [N]o "
  261. [ XK(29)"" Q29&95XS(29) (Q29=="Y | Q29=="N)JL YA ] Q29YD
  262. \
  263. R*
  264. R*  W -    "Window" macro - create instruction window.
  265. R*    Enter:  Q100 = size of desired window.
  266. R*        Q29  = "Y" if scroll bars enabled.
  267. R*
  268. RI(W)\
  269. Q29="Y[
  270.     YJN 10 1 YWI    !Enable scroll bars if needed
  271.     0YWB(1) Q100    !Borderless window below
  272.     ][
  273.     (.wt>1)[ YWI ]    !Delete multiple windows
  274.     YWB(1) Q100        !Else a normal window
  275.     ]
  276. Q26YEA            !Set editing attribute
  277. YWS(1) Q27YEA        !Set attribute in instruction window
  278. YWS(@)
  279. \
  280.