home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / S / VDEMAC2.ZIP / VDEMACRO.DOC < prev    next >
Text File  |  1990-04-13  |  13KB  |  303 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. ============
  8. VDEMACRO.LBR
  9. ============
  10.  
  11.  
  12.  
  13. Some Useful Macro Key Definitions for
  14. Eric Meyer's Video Display Editor v2.6x
  15.  
  16.  
  17.  
  18.  
  19. The macro key feature of Eric Meyer's VDE enormously extends the rangeáì
  20. and power of this small, simple, and speedy word processor.  This fileáì
  21. discusses the permanently installed macros I use.  Some of them may beáì
  22. of use to you as they are, and you may want to adapt some of the ideasáì
  23. to your own uses.
  24.  
  25. VDE262.VDK is the one I use routinely in my straight word processingáì
  26. version of VDE.  You can install it in a test copy of VDE to see howáì
  27. these particular macros work.  The macro key codes look like this whenáì
  28. called up by VINST262:
  29.  
  30. MACRO KEYS:  (00D6 bytes free)
  31. <0><Q>F R E D   H A I N E S^M^M733 north king's road  apt 331^M
  32.       los angeles, california  90069^Mtelephone       [213] 658-8664^M
  33. <1><Q>^Q^S^X^[=^M]^S^V ^V^D^[![
  34. <2>^[=^M0^V^I^V^B^G^[![^[0^X
  35. <3>^[=^M0^T^B^N^[0^X
  36. <4>^N^N^N^N^N^N^M^M^Mpage #^O^F^G^G@@@^E^E^E^E^E^E^E^E^C^C^C
  37. <5>^N^N^N^N^N^N^M^M^M- # -^O^C^G^G^E^E^E^E^E^E^E^E^C^C^C
  38. <6>^Qa^P^M^M ^P^M^M*^[^Qr
  39. <7><Q>^P^[^P^I^P^K^P^[9
  40. <8><Q>^[~ <^[0^^^[~ 0
  41.  
  42. Select <0-9> or <Z>ap; or <CR> to exit:
  43.  
  44. I've folded lines 1 and 9, but this is more or less what you'll see.
  45.  
  46.  
  47.                                                     ESC-0 - LETTERHEAD
  48.  
  49. Macro ESC-0 types my letterhead to the screen - on the left side,áì
  50. since I prefer a flush left style, but it could be modified to printáì
  51. in the center or at the right without too much trouble.  The <Q> ináì
  52. angle brackets is added at the end of typing the macro in, when youáì
  53. are asked to select <N> for "no repeat," or <Q> for quiet.  There's noáì
  54. particular reason to watch this happening, and <Q> is faster.
  55.  
  56.  
  57.                                            ESC-9 - BOLDFACE LETTERHEAD
  58.  
  59. ESC-9 goes back and make the letterhead boldface by adding CTRL-D's toáì
  60. the beginning and end of each line.áì
  61.  
  62. <9><Q>^V^[~F<^P^D^Q^D^P^D^D^D^P^D^Q^D^P^D^D^P^D^Q^D^P^D^D^P^D^Q^D
  63.       ^P^D^D
  64.  
  65. The code immediately after the ^V (to switch insert mode back on,áì
  66. since VDE always switches insert off when it executes a macro), ^[~F<,áì
  67. is the VDE code which causes the cursor to search backwards until itáì
  68. reaches a capital F, and the rest of the line is more or less selfáì
  69. explanatory.  It embeds a ^D, issues a ^QD to skip to the end of theáì
  70. line, embeds another ^D, and so forth.  If your first name doesn'táì
  71. begin with F you would have to substitute your own initial, of course,áì
  72. and, if that is duplicated elsewhere in the letterhead, you would haveáì
  73. to repeat the ^[~(initial)< code.
  74.  
  75. Another way to do this, if you want to use the letterhead only at theáì
  76. top of your document, is to code the macro to go to the top of theáì
  77. document with a ^QR, then search forward instead of backward for theáì
  78. initial letter.
  79.  
  80. I use two separate macro keys partly because the text exceeds theáì
  81. allowable limit of characters for a single macro key, and partlyáì
  82. because I like to choose whether to make the letterhead boldface oráì
  83. not.
  84.  
  85. In fact these macros are overly fancy - it's just as easy to keep aáì
  86. file with the letterhead in it and read it in with a ^KR command - butáì
  87. they do illustrate some features of VDE's macro facility.  You canáì
  88. keep a letterhead block file in any user area, because the ^KR commandáì
  89. lets you specify the directory as well as the file name.
  90.  
  91.  
  92.                                 ESC-1 - MAKE PARAGRAPH REFORMABLE
  93.  
  94. ESC-1 replaces all hard carriage returns from the cursor position toáì
  95. the end of the paragraph with soft carriage returns, allowingáì
  96. reformatting with ^B.
  97.  
  98. <1><Q>^Q^S^X^[=^M]^S^V ^V^D^[![
  99.  
  100. The coded commands first return the cursor to the beginning of theáì
  101. line, then drop it down one line.  The special VDE macro code ^[=^M]áì
  102. is a conditional jump to the end of the macro - quitting - if theáì
  103. character under the cursor is a carriage return, as it would be if theáì
  104. cursor were on the blank line at the end of a paragraph.
  105.  
  106. This macro treats paragraphs which aren't separated by a blank line asáì
  107. a single paragraph.  If you use an indented first line as theáì
  108. indication of a paragraph, you have to add hard carriage returns whereáì
  109. you want them before reforming.
  110.  
  111.  
  112.                                ESC-2 AND ESC-3 - CHANGE PARAGRAPH FORM
  113.  
  114. ESC-2 and ESC-3 are companion pieces.  I prefer to work in flush leftáì
  115. block paragraph style with a blank line to denote the paragraph (likeáì
  116. this document), but I often have to reformat a document in normaláì
  117. indented paragraph style without blank lines between, particularlyáì
  118. when preparing for publication - editors want indented paragraphs andáì
  119. doublespacing.
  120.  
  121. If you put the cursor at the head of the text and do ESC-2, VDEáì
  122. automatically convert the entire document to indented form.  Toáì
  123. doublespace, set doublespace with ^OS, go back to the top, and set upáì
  124. a temporary macro (ESC-M) with nothing but ^B repeated with the *áì
  125. command.  ESC-3 reverses the process.  First singlespace the document,áì
  126. then run ESC-3 on it.
  127.  
  128. <2>  ^[=^M0  ^V^I^V  ^B^G  ^[![  ^[0^X   [spaces added for
  129.                                           clarity]
  130.  
  131. <3>  ^[=^M0  ^T^B^N  ^[0^X
  132.  
  133. The sequence ^[=^M0 is a conditional jump to label 0 if the characteráì
  134. at the cursor is a carriage return.   If it isn't a carriage return,áì
  135. the code proceeds to the next sequence, ^V^I^V, which switches insertáì
  136. mode on, does one tab (I have a tab fixed at column six for theáì
  137. standard 5-column indentation), and switches insert off again -áì
  138. necessary because this macro loops.
  139.  
  140. ^B reformats the paragraph and the ^G deletes the blank line betweenáì
  141. paragraphs.  A ^G is safer than a ^Y here, because it accomplishes theáì
  142. same purpose, removing a blank line, by deleting a single character,áì
  143. the carriage return.  If something goes awry and it tries to operateáì
  144. on a non-blank line, you will lose only the first character, not theáì
  145. whole line.
  146.  
  147. The ^[![ is a special case of the jump-to-label instruction whicháì
  148. jumps to the beginning of the macro and runs it again.  If the cursoráì
  149. is then on a carriage return instead of the beginning of a paragraph,áì
  150. the ^[=^M0 causes a jump to the ^[0 label and the ^X, which pushes theáì
  151. cursor go down another line to search for the beginning of the nextáì
  152. paragraph.
  153.  
  154. This macro, ESC-2, could actually be set up for either <N> no repeatáì
  155. or <Q> quiet, since it loops of its own accord, but I prefer to watcháì
  156. what's happening in case of anomalies in my formatting - you canáì
  157. always abort a running macro by hitting ESC.
  158.  
  159. The ^[=^M0 and ^[0^X codes in ESC-3 work just as they do in ESC-2, andáì
  160. the code between simply does a ^T to remove the indentation, a ^B toáì
  161. reformat the paragraph, and a ^N to force a blank line before the nextáì
  162. paragraph.  This macro does not loop on its own, so you have toáì
  163. specify at runtime how many times you want it to repeat.
  164.  
  165.  
  166.                                  ESC-4 AND ESC-5 - CUSTOM HEADERS
  167.  
  168. ESC-4 and ESC-5 are also companion pieces - both produce customáì
  169. headers.  If you put your cursor on the first line of page 2 and doáì
  170. ESC-4, the macro will force 6 clear lines for a 1" top margin, thenáì
  171. put a header on line 4 that looks like this:
  172.  
  173.  
  174.  
  175. @@@                                                           page #
  176.  
  177.  
  178. It then measures off a full page (of 58 lines on a 66-line page) andáì
  179. positions the cursor at line 1 of page 2.  Since I like to controláì
  180. exactly where the page break comes I normally run this macro onlyáì
  181. once, but specifying the * (continuous) command will put the header onáì
  182. one four of every page of the document.  Best not to do in quiet mode,áì
  183. because the macro doesn't really know when it has run out of text andáì
  184. will go on adding header lines endlessly.
  185.  
  186. I then number the pages by doing a repeated ^QF on the symbol # andáì
  187. numbering the pages in sequence.  I then do a temporary macro -áì
  188. ^QF@@@^MText - to replace the @@@ with whatever "Text" I choose.  It'sáì
  189. better to use a macro than a straight ^QF to do this, since "Text"áì
  190. will be written in non-insert mode and will not displace the pageáì
  191. number over on the right.
  192.  
  193. ESC-5 is very similar to ESC-4, but makes a less formal header that Iáì
  194. use for short documents like personal letters, a simple - # - in theáì
  195. center of line 4 of every page.
  196.  
  197.  
  198.                                        ESC-6 - REMOVE CARRIAGE RETURNS
  199.  
  200. ESC-6 is a straightforward sequence of ordinary VDE commands whicháì
  201. changes all the hard carriage returns in a document into soft carriageáì
  202. returns - space ^M.
  203.  
  204. <6>^Qa^P^M^M ^P^M^M*^[^Qr
  205.  
  206. The code gives the ^QA command to search all instances of ^M andáì
  207. replace them with space-^M, then answers the prompt for "how manyáì
  208. times?" with *, and then returns to the top of the document.
  209.  
  210.  
  211.                                                ESC-7 - SET LEFT MARGIN
  212.  
  213. This macro is the one I use the most.  I usually run SLM (Set Leftáì
  214. Margin) before invoking VDE to set a left margin on my Comrex CR-IIáì
  215. (Diablo 1610 compatible) daisywheel printer, but inevitably there areáì
  216. times when I forget to do so.  Doing ESC-7 on the top line of the fileáì
  217. inserts into it the printer's code for setting a left margin, ESC TABáì
  218. nnH ESC 9, where nn is the ascii equivalent of the left margin columnáì
  219. expressed in hex.
  220.  
  221. In this case I use ^K = 11 decimal = 0B hex, which starts printing ináì
  222. column 11, leaving a 10-column, 1" left margin.  This is the margin Iáì
  223. use most frequently, but it is easy enough to vary by overwriting theáì
  224. ^K with another ascii code, ^F for a 5-column, 1/2" margin, foráì
  225. example.
  226.  
  227. <7><Q>^P^[^P^I^P^K^P^[9
  228.  
  229. The ^P's in the command line are there to embed the following controláì
  230. code in the file.  Making it quiet with <Q> makes it marginallyáì
  231. faster.  What actually appears on your terminal's screen looksáì
  232. something like this:
  233.  
  234. ^[      ^K^[9
  235.  
  236. All characters but the 9 are in half-intensity highlight since theyáì
  237. are embedded control codes.  The tab doesn't appear at all, except asáì
  238. the actual space of a default tab.
  239.  
  240.  
  241.                                           ESC-8 - REVERSE CASE OF WORD
  242.  
  243. This macro reverses the case of single word.
  244.  
  245. <8><Q>^[~ <^[0^^^[~ 0
  246.  
  247. The code ^[~ < moves the cursor to the left until it hits a space.áì
  248. The code ^[0 is a label.  The ^^ is the VDE command to reverse theáì
  249. case of a character (that's CTRL-^).  The code ^[~ 0 is a conditionaláì
  250. jump back to the label - as long as the character at the cursor is notáì
  251. a space, the macro will loop back to the label and do another ^^.áì
  252. When it hits the space at the end of the word the macro quits.
  253.  
  254. Note that the first code, ^[~ <, moves the cursor left until it findsáì
  255. the space before the word, which means that the cursor can be anywhereáì
  256. in the word when you issue the command, and the macro will stilláì
  257. reverse the case on every character in the word.
  258.  
  259.  
  260.                                                        MACRO SETS
  261.  
  262. It's conceivable that you would want to have more than one set ofáì
  263. macro keys for use with different applications.  VDE is so small thatáì
  264. it isn't a big problem to keep several copies of it under differentáì
  265. names, at least on a hard disk system, but the fact that the macro keyáì
  266. buffer is exactly three records long makes it possible to record,áì
  267. store, and load the macro keys separately if you are running ZCPR3.
  268.  
  269. Install a set of macro keys with VINST262.  Then use DDT or any otheráì
  270. debugger on VDE.COM.  Use the M command to move the three recordsáì
  271. containing the key definitions to the base of the TPA:
  272.  
  273. -m0280,03ff,0100
  274. -g0
  275.  
  276. SAVE 3 MACRO1.SET R to make a three-record file MACRO1.SET.  Then loadáì
  277. and run it with a multiple command line:
  278.  
  279. get 100 a0:vde.com;get 280 a0:macro1.set;go
  280.  
  281. This concept can be broadened to load entirely different front ends onáì
  282. VDE.  Since all customization of VDE - options, terminal, printer, andáì
  283. macro keys - is in the first three memory pages of the program, youáì
  284. can save, store, and reload as many different versions as you like asáì
  285. three-page front ends.  To load and run:
  286.  
  287. get 100 a0:vde.com;get 100 a0:vdevers1;go
  288.  
  289.  
  290.                                                       TEMPORARY MACROS
  291.  
  292. You can of course override permanently installed macros by making up aáì
  293. temporary macro and installing it on a macro key with the ESC-Káì
  294. command.  To clear the temporary macro keys and restore theáì
  295. permanently installed ones, just exit from VDE and reload it.
  296.  
  297.  
  298. Fred Haines
  299.  
  300. Glendale Littera RCPM/QBBS
  301. Abel Iwaz, sysop
  302. [818] 956-6164 [PC Pursuit]
  303.