home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 049 / vde173a.zip / VMACRO.REF < prev    next >
Text File  |  1994-09-03  |  33KB  |  594 lines

  1.  
  2.                                   VMACRO.REF
  3.                                   ----------
  4.                      Macro Reference for the VDE Editor:
  5.                          version 1.73A (03 Sep 1994)
  6.  
  7.                              (c)1987-94, E. Meyer
  8.  
  9.  
  10.  
  11. ================================  CONTENTS  ==================================
  12.  
  13.     (For QUICK START, SYNTAX, GENERAL INFORMATION etc. see the file VDE.DOC)
  14.  
  15.     (For a comprehensive COMMAND REFERENCE, see the file VDE.REF)
  16.  
  17.      8. MACRO INSTRUCTIONS:
  18.           A. Keystrokes and notation
  19.           B. Defining macros
  20.           C. Recording macros
  21.           D. Assigning macros to keys
  22.           E. Macro programming
  23.           F. Examples of useful macros
  24.  
  25.      9. MACRO REFERENCE, alphabetically by topic:
  26.             Autoexec macro, Chaining and calling, Counter variable, Define or 
  27.          record macro, Error handling, Function keys, Function key labels, Key 
  28.          definition files, Labels and jumps, Pause, Tests and loops, Toggle 
  29.          control.
  30.  
  31.     (For use of the VINST installation utility, see the file VINST.REF)
  32.  
  33.  
  34. ================================  8. MACROS  =================================
  35.  
  36.                           A. KEYSTROKES AND NOTATION
  37.  
  38.      Essentially, a macro is a sequence of keystrokes representing text and/or 
  39. VDE commands, which can then be repeated automatically or stored to a key for 
  40. future use in order to make frequently performed tasks easier.
  41.  
  42.      While this may sound quite straightforward, it is obviously necessary to 
  43. get such a key sequence EXACTLY correct for the macro to perform as intended; 
  44. therefore, the representations of macros in this manual present many 
  45. possibilities for confusion.  First, some basics: the characters "[]" are 
  46. often used to signify the pressing of a single key, like "[Esc]" -- but they 
  47. are not used when that key is exhibited as part of a macro or multi-key 
  48. command, like "Esc&F2".  Also, don't be confused by the fact that a single 
  49. bracket can also appear as part of certain macro commands, like "Esc~^M]".  
  50. The character "^" is normally used to indicate control-key combinations, as in 
  51. "^M" for Ctrl-M; but there are special cases when the character "^" itself 
  52. needs to be typed, as in "Esc&^F2".
  53.  
  54.      A space will often be used here to separate groups of keystrokes to make 
  55. a macro easier to read and understand -- but these spaces ARE NOT part of the 
  56. macro, and should not be typed in if you are trying to define it.  Any spaces 
  57. that actually ARE part of the macro and SHOULD be typed in will be represented 
  58. by the underline character "_".
  59.  
  60.      Finally, there are occasional differences between the keystrokes you 
  61. would actually type in order to perform a task, and those that must be typed 
  62. in order to enter this sequence at the macro definition prompt.  At all VDE 
  63. string prompts, there are certain control-characters which control the 
  64. entering of the string itself; for the macro definition command Esc[, this is 
  65. a somewhat shorter list than for other prompts, but it still includes:
  66.         [Enter] or ^M or ^J -- terminates entry of the string
  67.                [BkSp] or ^H -- deletes the last character entered
  68.                          ^R -- replays the last macro entered
  69.                          ^P -- enters codes like these in macros
  70. (Also, of course, ^[Break] aborts string entry.)  This means that actually 
  71. ENTERING Enter/^M/^J or BkSp/^H or ^P (or ^R as the first key) AS PART OF THE 
  72. MACRO ITSELF requires the ^P prefix first.  If you forget this prefix, of 
  73. course, you will instead see the key perform its function indicated above.
  74.      Throughout this manual, macros are presented as they actually function, 
  75. since this is easier to understand; that is, they DO NOT include such extra ^P 
  76. prefixes.  If you are trying to enter a macro at the definition prompt, you 
  77. must remember to use caution with the above control keys!  (See also ^P 
  78. NESTING, below.)
  79.      Another useful fact to remember is that two-key commands accept either an 
  80. ordinary letter or a control key for the second key -- that is, ^K^M and ^KM 
  81. can be used interchangeably to enter a placemark.  But entering ^K^M in a 
  82. macro definition would present a problem (requiring you to type ^K^P^M 
  83. instead), whereas ^KM is just fine.  And, last, the Left-arrow key or ^S is 
  84. easier to enter into a macro than [BkSp] or ^H, since no prefix is required.
  85.  
  86.      EXAMPLE: Consider the following macro, whose purpose is explained more 
  87. fully below under EXAMPLES OF USEFUL MACROS:
  88.  
  89.                    ^QS ^X Esc=_] Esc=^M] ^S_^D Esc![
  90.  
  91. If you want to type this in at the macro definition prompt, you should note 
  92. that there are only two actual spaces IN the macro, indicated by "_"; the rest 
  93. are present merely for visual separation of different groups of keystrokes.  
  94. Also, the ^M will require a ^P prefix.  So after invoking the Esc[ command to 
  95. define a macro, the actual keys you would type are:
  96.  
  97.        Macro:  Ctrl-Q S Ctrl-X Esc = Space ] Esc = Ctrl-P Ctrl-M ]
  98.                    Ctrl-S Space Ctrl-D Esc ! ]
  99.  
  100. That's a total of 18 keystrokes, not including a final [Enter] to terminate 
  101. the definition.  If you have done this correctly, you will see on screen 
  102. something like this (the underlined letters will be highlighted as control- 
  103. codes):
  104.                 Macro:  QSX[= ][=M]S D[![
  105.                         - --   - - - --
  106. Note that the [Esc] key, which is actually ^[, displays as a highlighted "[".
  107.  
  108.  
  109. ----------------------------- B. DEFINING MACROS -----------------------------
  110.  
  111.  
  112.      To DEFINE a macro, type Esc[.  Macros execute EXACTLY as though you had 
  113. typed the given keys yourself; this means that every keystroke, including 
  114. answers to prompts, [Enter]s, and so on, must be properly included, so plan 
  115. ahead carefully, with pen and paper if necessary.
  116.      Any PC keys can be entered at this prompt; a few, like arrow keys, will 
  117. display with a recognizable symbol, but most (PgUp, etc) will simply display 
  118. as a highlighted asterisk "*".  (VINST is capable of displaying the full 
  119. keyname, if you later edit the definition.)  Even MenuBar commands (except 
  120. {User:}) can be used in macros, with the ^[Esc] command (see MENUBARS).
  121.  
  122.      Once you have entered the macro definition, you will be asked whether you 
  123. want to Use it immediately, or Store it (on storing, see ASSIGNING MACROS TO 
  124. KEYS).  If you're going to use it now, you need to decide whether you want the 
  125. macro to repeat (and if so how many times), and whether you want to watch it 
  126. happen or not:
  127.             VDE asks "Make Quiet, No-repeat, Both?"  Reply "Q" for 
  128.          Quiet (fast) operation, or press [Enter] for visible 
  129.          (slower) execution.  (The "N" option is intended for 
  130.          storing keys, but can also be typed here to skip the next 
  131.          question.)
  132.             VDE asks "Repeat count?"  Type the number of times to 
  133.          execute (0-254), or just [Enter] for 1; or "*" to repeat 
  134.          indefinitely.
  135.  
  136.      When a macro executes, the "!" flag appears in the header; normally, you 
  137. can also see its effects as it executes.  You can cancel it at any time by 
  138. pressing [Esc].  If you choose to speed up macro execution by specifying 
  139. "Q"uiet mode, only the header will be updated as the macro runs.  (Don't do 
  140. this if the macro uses any commands that require user input -- the necessary 
  141. prompt would not display!)
  142.      By default, macros will stop automatically if an error condition occurs, 
  143. in which case the error message will display briefly; or if the cursor 
  144. attempts to move past the top or end of the file, in which case no error 
  145. displays.  (See also ERROR HANDLING.)  Thus some macros will halt on their own 
  146. when they reach the end of a file; others may have to be terminated manually, 
  147. by pressing [Esc].
  148.      Once defined, a macro can be recovered by typing ^R to replay it at the 
  149. Esc[ prompt, so that you can choose to Use it again, or Store it if you did 
  150. not previously do so.
  151.      ^F, when entered as part of an input string, normally inserts the name of 
  152. the current file (see PROMPTS).  In a macro definition, it remains an ^F, 
  153. expanded to the current filename only when the macro actually executes.  This 
  154. can be useful to refer to the current file when running compilers and file 
  155. utilities.  Thus, if you define the macro
  156.                      AltR compile_^F_/g_/r1 [Enter] [Esc]
  157. the ^F embedded in the string will be expanded, so that the DOS command 
  158. executed by AltR when the macro is invoked will actually be something like
  159.                      compile C:\PGM\MYPROG.C /g /r1.
  160.  
  161.  
  162.      EXAMPLES OF ^P NESTING.  Note that in some situations, the use of ^P as a 
  163. prefix for control keys at the macro definition prompt becomes nested.  
  164. Suppose you want to define a macro containing the word "counterrevolutionary", 
  165. with "counter" italicized.  The keystrokes you need to execute are:
  166.                      ^P^Ycounter^P^Yrevolutionary
  167. but to get these into a macro definition, you must type ^P TWICE to enter each 
  168. ^P (otherwise, ^P^Y will enter only the ^Y, which would delete a line!):
  169.               Macro: ...^PP^Ycounter^PP^Yrevolutionary...
  170.      Or, suppose you want to find the next occurrence of "Item" at the 
  171. beginning of a line.  The actual keystrokes needed are:
  172.                      ^QF^PMItem^[Enter]
  173. (Note the use of ^[Enter] instead of [Enter] to avoid the Options prompt.)  
  174. But to enter this as part of a macro definition, you will have to type:
  175.               Macro: ...^QF^PP^PMItem^P^[Enter]
  176.      Failure to nest ^P prefixes properly is one of the most common causes of 
  177. unexpected macro behavior.
  178.  
  179.      TECHNICAL NOTE: Ordinarily macros are completely self-contained, and 
  180. NEVER request input from the keyboard while executing (unless the input pause 
  181. commands Esc? or Esc: are used).  Even confirmation prompts like "Abandon 
  182. changes (Y/N)?", which may or may not pop up in normal usage of commands 
  183. affecting disk files, NEVER occur when a macro is running, so never include a 
  184. confirming "Y".  But there is one exception: using AltR to run another program 
  185. (or DOS shell) from a macro is tricky.  Any input requested by the program or 
  186. shell must be typed by you -- it cannot be included in the macro.  (VDE 
  187. resumes control only when the program or shell terminates; if the macro 
  188. continues, its next keystroke must be the [Esc] required to return to 
  189. editing.)
  190.  
  191.  
  192. ---------------------------- C. RECORDING MACROS -----------------------------
  193.  
  194.  
  195.      As an alternative to composing macros and using the Esc[ command to 
  196. define them, you can simply record a macro as you go about a task.  The main 
  197. advantages are that you can see the effects as you go, and none of the 
  198. additional ^P keystrokes sometimes necessary for entering commands at the 
  199. macro definition prompt will be needed.  (On the other hand, a recorded macro 
  200. must be a simple series of keystrokes; it cannot contain programming commands 
  201. like jumps and tests.)
  202.  
  203.      Just press Esc" to activate recording; type away; and press Esc" again to 
  204. conclude.  You will then be asked whether to use or store the macro you have 
  205. created, just as if you had entered the macro at the Esc[ prompt.
  206.      While recording, a quote mark (") will be visible in the upper right 
  207. (prefix) area of the header.  If you make an error while recording, use Esc" 
  208. to stop recording, press [Esc] at the prompt to quit, and start over.
  209.  
  210.      NOTES: Because macros don't nest, Function key commands themselves (and 
  211. also the {User:} MenuBar) cannot be used while macro recording is in progress.  
  212. Any other keystrokes can be recorded, including all other MenuBar selections.
  213.      Be careful when creating macros by recording [BkSp], [Del], [Home], or 
  214. [End]; the functions of these keys are VINST options and may differ in someone 
  215. else's copy of VDE, so you may wish to use command equivalents like ^S, ^G, 
  216. ^QS, ^QD instead.
  217.  
  218.  
  219. ------------------------ D. ASSIGNING MACROS TO KEYS -------------------------
  220.  
  221.  
  222.      Up to 48 macros can be assigned to function keys; they can then be 
  223. recalled and used with one keystroke.  Each PC function key can be used alone 
  224. or with Shift, Ctrl, or Alt, to produce:
  225.                     [F1]...[F10]  =  F1....F10 in VDE notation
  226.               Shift-[F1]...[F10]  =  !F1..!F10
  227.                Ctrl-[F1]...[F10]  =  ^F1..^F10
  228.                 Alt-[F1]...[F10]  =  @F1..@F10
  229. And, if you have an Enhanced (101-key) AT keyboard, also:
  230.               F11, F12, !F11, !F12, ^F11, ^F12, @F11, @F12
  231. VDE comes with [F1] set as a "Help" key (^J), but this can be changed.
  232.  
  233.      For those who find function keys difficult to remember, you can also 
  234. assign a letter or digit to invoke a definition with the [Esc] key; thus, if 
  235. your Address is on [^F3], you could also call it up with EscA.
  236.  
  237.      The Esc[ command (see MACRO DEFINITION) gives the option of Storing the 
  238. macro definition to any function key, so that the macro can later be executed 
  239. simply by pressing that key.  If you choose "Store",
  240.             VDE asks "Make Quiet, No-repeat, Both:".  Reply "Q" for 
  241.          a key that executes in Quiet (fast) mode; "N" for a key 
  242.          that runs once, without asking for a repeat count; or "B" 
  243.          for both of these.  Press [Enter] instead for a key that 
  244.          executes just like the "Use macro" option, visibly, asking 
  245.          for a repeat count first.
  246.             VDE asks "Store to key:".  Press the desired function 
  247.          key, from [F1] to [@F12].
  248.             VDE asks "Esc key:".  If desired, press a letter or 
  249.          digit, which can then also be used with [Esc] to invoke 
  250.          this key.
  251.             VDE asks "Label?"  Enter a label, up to 7 characters, 
  252.          for the key label line (see FUNCTION KEY LABELS).
  253.  
  254.      Don't choose "Q"uiet (or "B"oth) for a key that will request input from 
  255. you.  There are about 2000 bytes of storage available for all 48 keys, and a 
  256. 125 byte limit [in VDE; VINST can accept 253] for any one key.  You can delete 
  257. a key definition by entering a null macro string (Esc[, [Enter]) and storing 
  258. it to the key.  Pressing an undefined key gives an error.
  259.      Keys defined while editing in VDE last only during the current editing 
  260. session.  [To add a function key permanently to VDE.EXE, use VINST: either 
  261. enter it again in VINST, or write it to a file and read the file into VINST -- 
  262. see DEFAULT FUNCTION KEYS and DATA FILES.]
  263.  
  264.  
  265. ---------------------------- E. MACRO PROGRAMMING ----------------------------
  266.  
  267.  
  268.      "Macro programming" refers to a group of VDE commands that operate only 
  269. within a macro definition, and give you conditional control over the execution 
  270. of a macro.  Thus, instead of simply running straight through a sequence of 
  271. keystrokes, a macro can be constructed very much like a computer program, with 
  272. conditional or unconditional jumps from one part of the macro to another, 
  273. giving great flexibility and power.  Here is a brief introduction to the range 
  274. of macro programming commands.
  275.  
  276.      Jumps require "labels" to identify where to jump to.  VDE labels consist 
  277. of [Esc] followed by a letter A-Z or digit 0-9.  If you typed this from the 
  278. keyboard, it would be interpreted as an attempt to invoke a function key 
  279. definition by an alias (see FUNCTION KEYS) -- but in a macro, there is no 
  280. effect: it simply identifies a location in the macro.
  281.  
  282.      Esc! is the unconditional jump instruction.  Followed by A-Z or 0-9, it 
  283. causes execution of the macro to transfer to the command following that label, 
  284. instead of simply continuing as usual to the next command.  So, for example, 
  285. Esc!1 jumps to the label Esc1.  Thus the macro:
  286.  
  287.               This_is_ Esc!1 not_ Esc1 a_silly_macro.
  288.  
  289. would produce the text "This is a silly macro."  In contrast, the macro:
  290.  
  291.               This_is_ Esc1 not_ Esc!1 a_silly_macro.
  292.  
  293. would produce "This is not not not not not not not not not....", continuing 
  294. indefinitely until you press [Esc] to abort it.  (This is an example of what 
  295. programmers call an "infinite loop" -- occasionally useful, but generally an 
  296. unfortunate error!)
  297.      There are also two special predefined "labels": "[" indicates the 
  298. beginning of the macro, and "]" the end.  Thus Esc![ can be used to repeat the 
  299. macro from the start, and Esc!] can be used to terminate it from any point.
  300.  
  301.      Several commands allow the use of a counter variable.  Esc() sets the 
  302. value: for example, Esc(0) initializes it to zero.  The Esc+ command simply 
  303. increments the value; Esc- (minus) is a conditional jump, decrementing the 
  304. value, then jumping if it is zero to the specified label.  (In addition to a 
  305. label 0-Z, you may use "[" or "]", or "@" to avoid jumping entirely.)  
  306. Examples: Esc-] decrements the counter, jumping to the end (exiting) if it 
  307. reaches zero; Esc-@ simply decrements it, with no jump.  Thus the macro:
  308.  
  309.               This_is_a_ Esc(3) EscL silly_ Esc-X Esc!L EscX macro.
  310.  
  311. will produce the text "This is a silly silly silly macro."
  312.  
  313.      Conditional jumps, or tests, are performed by Esc= and Esc~.  Followed by 
  314. a character, then a label, they are conditional jumps: they jump IF the text 
  315. character at the cursor does (or for "~", does NOT) match the one specified.  
  316. Examples: Esc~_2 jumps to label 2 if the cursor character is NOT a space; 
  317. Esc=^M] jumps to the end (terminates) if the cursor character is a CR (^M).
  318.      Similarly, Esc< and Esc> test the cursor character's ASCII value and act 
  319. accordingly: thus Esc<A2 jumps to label 2 if the cursor character value is 
  320. less than ASCII "A" (41 hex), etc.
  321.  
  322.      The test commands (Esc=,~,<,>) can also be used in a second way, as self- 
  323. contained search loops.  If instead of a label you use the character ">" or 
  324. "<", the command will move the cursor right (or for "<", left) as long as the 
  325. character at the cursor does (or for "~", does NOT) match the one specified.  
  326. Example: Esc=_> moves right as long as the current character is a space (so it 
  327. stops on the first NONspace).  Of course you could have done the same thing by 
  328. programming an actual loop, with labels and a test and a right arrow command:
  329.  
  330.               Esc1 Esc~_2 ^D Esc!1 Esc2
  331.  
  332. but Esc=_> is simpler and more convenient.
  333.  
  334.      It is possible for one macro to chain (jump) to, or call, another macro.  
  335. This can permit construction of a single macro longer than the usual maximum 
  336. size; also, it often simply allows you to organize macros more efficiently and 
  337. conserve definition space.  Esc&, followed by a key identification like "!F1", 
  338. is used to chain to another key; the macro terminates when that key finishes.  
  339. Esc&& works similarly, but calls the other key, so that when it finishes, 
  340. control returns to the original macro at the point following the Esc&& 
  341. command.
  342.  
  343.  
  344. ------------------------ F. EXAMPLES OF USEFUL MACROS ------------------------
  345.  
  346.  
  347.      Remember that macro examples are given as they function, NOT including 
  348. the occasional ^P prefix you will need to enter certain control codes like ^M; 
  349. and that while keystrokes are often separated by spaces for clarity, the 
  350. underline symbol "_" is used to represent an actual space that you must type.
  351.  
  352.  
  353.                             SIMPLE MACRO EXAMPLES
  354.  
  355.      1. At its simplest, a function key is a way to reproduce keystrokes.  
  356. Thus, if you're writing a document that will refer to "World Wide Widgets Ltd. 
  357. (N.A.)" dozens of times, it will be easier (and cause fewer typos) if you 
  358. define this phrase as a macro and assign it to a function key like [F3].
  359.  
  360.      2. The macro repeat count is an easy way to repeat VDE commands.  Suppose 
  361. you have a horizontal bar installed as graphic character "Y", and you need to 
  362. enter a line of 70 of them.  You could press AltG, then Y, 70 times... or you 
  363. could define the macro:          AltG Y
  364. and then Use it with a repeat count of 70.
  365.      Similarly, to reformat an entire file, go to the top if necessary, then 
  366. at the macro prompt, just enter:   ^B
  367. Specify Quiet and indefinite repeat as options ("Q,*").  It will stop when it 
  368. reaches the end of the file.
  369.  
  370.      3. To view a file by scrolling slowly through it, use the macro:
  371.                           Esc; ^Z   or    Esc; ^C
  372. This pauses, then scrolls down (a line at a time with ^Z, a screen at a time 
  373. with ^C).  Don't make it Quiet, just use a repeat count of "*".  Press [Esc] 
  374. when you want to stop.
  375.  
  376.      4. This macro, with repeat count "*", would take all phrases in square 
  377. brackets "[]" found in a file, and make a list of them in a second file being 
  378. edited concurrently:
  379.             ^QR ^QF[^J ^G ^KB ^QF]^J ^G ^KK AltC AltN AltP [Enter] AltB
  380.  
  381.  
  382.                          SIMPLE FUNCTION KEY EXAMPLES
  383.  
  384.      1. This macro, which could be stored as No-repeat on a function key, re- 
  385. loads the current file, eliminating any changes made since it was last saved:
  386.                                ^KL ^F [Enter]
  387.  
  388.      2. A function key defined as ^QR ^N AltD ^OF would place the current date 
  389. at the top right of a letter.  Many VDE users set up a function key to produce 
  390. a personalized letterhead: for example, the macro
  391.             ^N John_Doe ^OC ^N 123_Main_St ^OC ^N City,_State ^OC
  392. will insert that three-line address, neatly centered.  You can add print 
  393. effects (bold, italic) to suit your taste.  For a solid line separating this 
  394. from the body of the letter, try adding onto the end:  ^N ^PS ^OF ^E ^PS ^X
  395.  
  396.      3. Function keys can be used to create powerful new commands, for 
  397. example: ^D ^A ^KB ^F ^KK marks the current word as a block.  And, similarly, 
  398. ^QS ^KB ^X ^KK marks the current line as a block.
  399.  
  400.  
  401.                           MACRO PROGRAMMING EXAMPLES
  402.  
  403.      1. This macro moves to the start of the current paragraph:
  404.                         ^QS ^S^S Esc=_[ ^D^D
  405. Like the rest of the examples in this section, it might best be stored Quiet, 
  406. No-Repeat to a function key.
  407.  
  408.      2. Moving to the start of the current sentence is a bit more complicated, 
  409. but here is a macro program to do it:
  410.     Esc~.1 ^S Esc1 Esc~.< ^D Esc=_2 Esc=^M2 ^S^S Esc!1 Esc2 ^D Esc=_2 Esc=^M2
  411. You could explain this in programmer's pseudo-code as:
  412.               If not "." goto label1    ;move left if already on period
  413.               Move left
  414.      label1:  While not "." move left   ;move left to previous period
  415.               Move right                ;move right to following character
  416.               If " "  or ^M goto label2
  417.               Move left twice           ;skip over a period if it's not
  418.               Goto label1               ;  followed by a space or return
  419.      label2:  Move right                ;okay, now move right as long
  420.               If " " or ^M goto label2  ;  as you see a space or return
  421.               (all done)
  422.  
  423.      3. If you have some text that you can't reformat because every line ends 
  424. in HARD CRs, this key will "soften up" the current paragraph, leaving just one 
  425. HARD CR at the end:      ^QS ^X Esc=_] Esc=^M] ^S_^D Esc![
  426. (Note that this requires paragraphs to have first-line indents or a blank line 
  427. betwen each of them.)
  428.  
  429.      4. If you want to produce a "pure ASCII" file for software that can't 
  430. accept control codes (other than CR,LF) or IBM graphics, here is a key 
  431. definition that will filter these out before you save to disk (use filemodes 
  432. /A,U,N):     Esc*f EscB Esc>~X Esc=^MN Esc<_X EscN ^D Esc!B EscX ^G Esc!B
  433.  
  434.      5. This macro moves the cursor to the center of the current line; note 
  435. how the counter variable is used to figure the line length, then move back 
  436. only halfway:   ^QS Esc(0) Esc1 Esc+ ^D Esc~^M1 Esc2 Esc-] Esc-] ^S Esc!2
  437.  
  438.      6. Many programming languages use nested sets of parentheses, for example 
  439. "{}" in C.  This macro, when the cursor is placed on an open bracket "{", will 
  440. move ahead to find the closed bracket "}" that matches it:
  441.        Esc~{] Esc(0) Esc1 Esc~{2 Esc+ Esc!3 Esc2 Esc~}3 Esc-] Esc3 ^D Esc!1
  442.  
  443.  
  444.  
  445. ============================= 9. MACRO REFERENCE =============================
  446.  
  447.  
  448. AUTOEXEC MACRO -  VINST can designate any function key definition you create 
  449.     as "autoexec", meaning a macro that will execute automatically whenever 
  450.     you first enter VDE.  This feature can be used for a variety of purposes, 
  451.     including changing defaults not available through VINST options.  See also 
  452.     FUNCTION KEYS.
  453.          Notes: if you load multiple files, remember that for settings which 
  454.     are specific to each file (like margins), only the first file will be 
  455.     affected.  You cannot use a utility like KEYSTACK that stuffs input into 
  456.     the DOS keyboard buffer before running VDE, if an autoexec macro exists.
  457.  
  458. CHAINING AND CALLING (Esc&,&&) - Esc&, followed by a key identification like 
  459.     "!F1", is used to "chain" (or jump) to another function key.  Use "!,^,@" 
  460.     for Shift, Ctrl, Alt; and after the "F", a single digit "1"-"9", or "A"- 
  461.     "C" for 10-12.  ("0" is also accepted for F10.)  Examples: Esc&F2 chains 
  462.     to F2; Esc&^FB chains to Ctrl-F11.
  463.          Esc&& works similarly but "calls" the other key, returning when it 
  464.     finishes.  Calls may be nested at most 4 deep.
  465.  
  466. COUNTER VARIABLE (Esc(),+,-) - Esc(n) sets the counter value to "n".  Esc+ 
  467.     simply increments the value; Esc- (minus) is a conditional jump, 
  468.     decrementing the counter, then jumping if it is zero to a specified label.  
  469.     (Besides a label 0-Z, you can use "[" or "]" for the start or end, or "@" 
  470.     to decrement without jumping at all.)
  471.          The counter can run "negative", though it is actually an unsigned 
  472.     integer: if you decrement it from 0, it becomes 65535 (effectively -1); if 
  473.     you increment it from 65535, it becomes 0.
  474.  
  475. DEFINE OR RECORD MACRO (Esc[,") - To define a macro, type Esc[.  You will be 
  476.     asked for the macro definition; for full instructions, see DEFINING 
  477.     MACROS.  Once defined, you will have the option to Use the macro 
  478.     immediately or to Store it to a key.
  479.          Even if you did not Store your last macro when you originally defined 
  480.     it, you can still re-Use (or Store) it at a later time by using ^R 
  481.     (replay) at the Esc[ prompt.
  482.          As an alternative to composing macros and using the Esc[ command to 
  483.     type them in, you can simply record a macro as you go about a task.  Press 
  484.     Esc" to activate recording; type away; then press Esc" again to conclude.  
  485.     While recording, a quote mark (") will be visible in the upper right 
  486.     (prefix) area of the header.  If you make an error while recording, use 
  487.     Esc" to stop recording, press [Esc] at the prompt to quit, and start over.
  488.  
  489. ERROR HANDLING (Esc$) - Esc$ can specify a label where macro execution should 
  490.     continue if an error occurs (normally, execution would terminate).  Thus, 
  491.     after the command Esc$E, any command resulting in an error (like "Not 
  492.     Found") will cause a jump to label E, ignoring the error.  You can also 
  493.     use the special characters "[","]" to jump to the beginning or end of the 
  494.     macro, or "@" to simply ignore errors, not jumping anywhere, or "$" to 
  495.     return to the normal default of halting on any error.
  496.  
  497. FUNCTION KEYS ([F1]...[F12], EscA-Z,0-9) -  Macros can be assigned to function 
  498.     keys, either alone or with Shift, Ctrl, or Alt (!,^,@) for a total of 48 
  499.     function keys.  These keys can be labeled for easy remembering (see 
  500.     FUNCTION KEY LABELS), or you can assign a letter or digit to invoke a 
  501.     definition with the [Esc] key; thus, if your Address is on [^F3], you 
  502.     could also call it up with (say) EscA.  For detailed instructions, see 
  503.     ASSIGNING MACROS TO KEYS.
  504.          (Note: users of VDE prior to version 1.7 will recall EscA-Z as a 
  505.     separately definable set of MACRO KEYS; they now function simply as 
  506.     mnemonic aliases for function keys.)
  507.  
  508. FUNCTION KEY LABELS (^OU) - To help you remember the purpose of your function 
  509.     key definitions, the ^OU command toggles the display of a label line at 
  510.     the bottom of the screen.  When a key is defined, its number will appear 
  511.     on the label line, followed by the label (if any) entered when the key was 
  512.     stored.
  513.          The label line is sensitive to keyboard shift status; if you press 
  514.     and hold Shift, Ctrl, or Alt for a moment, the labels will change to show 
  515.     those for the shifted function keys.
  516.          On 80-column screens, 10 labels are visible; in 40-column mode, 5.  
  517.     Labels for the F11, F12 keys only appear on screens of 96 or more columns.
  518.  
  519. KEY DEFINITION FILES (AltU) -  These files save function key definitions and 
  520.     labels, and should be given a file type of ".VDF".  You can load such a 
  521.     file, along with your text file(s) to edit, from the command line (see 
  522.     SYNTAX).
  523.          AltU can be used while editing: it will ask whether you want to 
  524.     "L"oad or "S"ave such a file, then prompt for the name of the file.  If 
  525.     you load a .VDF file, those definitions will replace any previous ones.  
  526.     If you save, the current definitions will be written to the file.  [.VDF 
  527.     files can also be created or installed as defaults in your copy of VDE, 
  528.     using VINST.]
  529.  
  530. LABELS AND JUMPS (Esc0..Z,Esc!) - Esc0..Z, when placed in a macro, function 
  531.     simply as local "labels" 0..Z.  They have no effect, but can be "jumped" 
  532.     to by other commands.
  533.          Esc! followed by 0..9,A..Z is a "jump" instruction, causing macro 
  534.     execution to resume with the command following that label.  Example: Esc!2 
  535.     jumps to label 2.  As two special cases, Esc![ jumps to the beginning of 
  536.     the macro, and Esc!] jumps to the end (exits).
  537.          Note that Labels can also be referenced by the test commands, which 
  538.     perform conditional jumps (see TESTS AND LOOPS).
  539.  
  540. PAUSE (Esc;,Esc?,Esc:) - Esc; gives a brief pause before macro execution 
  541.     continues, so the user can see what's happening on screen.  Use two or 
  542.     more to get a longer pause.
  543.          Esc? accepts text or commands from the keyboard during macro 
  544.     execution.  The header's "!" flag turns into "?" when user input is 
  545.     expected.  Anything except macro and function key commands may be used.  
  546.     [Esc] terminates input, returning control to the macro.  ^[Break] aborts.
  547.          Esc: makes the following command take its input from the keyboard.  
  548.     The macro resumes when that command is completed.  Examples: Esc:^QF 
  549.     allows you to type in the string to find; Esc:Esc! actually lets you type 
  550.     the label to jump to.
  551.  
  552. TESTS AND LOOPS (Esc=,~,<,>) - Esc= and Esc~ perform tests on the character at 
  553.     the current cursor position.  There are two ways to use them:
  554.               (1) Followed by a character, then a label (0-Z,[,]), 
  555.          they are conditional jumps: they jump to the label IF the 
  556.          cursor character does (or for "~", does NOT) match the one 
  557.          specified.
  558.              (2) Followed by a character, then ">" or "<", they are 
  559.          search loops.  They will continue to move the cursor right 
  560.          or left as long as the cursor character does (or for "~", 
  561.          does NOT) match.
  562.          Similarly, Esc< and Esc> test the cursor character's ASCII value and 
  563.     act according to whether it is less, or greater, than the specified value.  
  564.     (See ASCII table in VINST.REF)
  565.          (Note: place and block markers, since they are not part of the file 
  566.     text, will fail any test.  If you need to check for their presence, you 
  567.     can use Esc<^@ [that's 00 hex, entered as ^P@] since no actual character 
  568.     could be <0 and fail this test.)
  569.  
  570. TOGGLE CONTROL (Esc*) -  "Toggle" commands can create difficulties when used 
  571.     in macro and function keys: ^V, for example, toggles insert mode.  But 
  572.     when you plan a function key, you don't necessarily know how Insert will 
  573.     be set when the key is used!  So if you use ^V in the macro, you don't 
  574.     know whether you just turned it off or on; you might be overstriking or 
  575.     inserting, and can't tell.
  576.          The Esc* command provides a solution, by letting a macro specify an 
  577.     exact state for each toggle.  Esc* must be followed by a LETTER to 
  578.     identify a toggle, UPPERcase to turn it ON or LOWERcase to turn it OFF.  
  579.     (Insert and Justify each have a third state, as well.)  For example, Esc*i 
  580.     will set INSERT OFF, regardless of its previous state.  The toggles are:
  581.               Autoindent     (^OA)  'a'=off  'A'=on
  582.               Doublespace    (^OS)  'd'=off  'D'=on
  583.               auto Format    (^OM)  'f'=off  'F'=on
  584.               Hyphenation    (^OH)  'h'=off  'H'=on
  585.               Insert         (^V)   'i'=off  'I'=on  'W'=word
  586.               Justification  (^OJ)  'j'=off  'J'=on  'R'=remove
  587.               Proportional   (^OK)  'p'=off  'P'=on
  588.               Varitab        (^OV)  'v'=off  'V'=on
  589.               margin release (^OX)  'x'=off  'X'=on
  590.  
  591.  
  592.  
  593. ==============================[end VMACRO.REF]================================
  594.