home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 1 / CD-ROM_Today_-_The_Disc_1_April-May_1994.iso / utils / vde / vdemacro / macrovde.vsa
Text File  |  1992-06-14  |  6KB  |  101 lines

  1. A macro is a set of characters or a set of commands that is called 
  2. up by a single command.  In VDE there are two main kinds:  
  3. regular-key and function-key commands  The two types largely work 
  4. the same, but they are loaded separately, as .vdk or as .vdf 
  5. library files.  There are 36 regular-key macros:  ESC 0 - ESC 9 
  6. and ESC A - ESC Z; jointly referred to as ESC 0...Z.  They are 
  7. called up by striking the escape key, followed by the letter or 
  8. number (top row) key.  A function-key macro is invoked by striking 
  9. a function key, alone or with ALT, SHIFT, or CTRL depressed; there 
  10. are thus 40 of these (48 if your keyboard has function keys 1-12).  
  11. To get access to a macro you must either create it on the spot or 
  12. have loaded it from a macro file.
  13.  
  14. Macros in VDE can be very simple---or very complex.  They can be 
  15. created by writing on the macro dialog line or by recording.  A 
  16. recorded macro is made by turning on the record function (with ESC 
  17. "), carrying out the set of commands, and toggling the recorder 
  18. off (ESC ").  As you record, you see the effects of the commands, 
  19. so you can see what the macro is going to do.
  20.  
  21. The other way is to strike ESC [ and enter the macro codes on a 
  22. dialog line.  This way is good for both very simple macros that 
  23. you can bang in without thinking and for macros so complex that 
  24. you have to work them out on paper first.  An ENTER ends this kind 
  25. of macro.
  26.  
  27. When you enter a macro on the dialog line, you have to keep one or 
  28. two things in mind.  Some keys are used to edit or terminate the 
  29. macro, and these keys must be preceded by a CTRL-P:  ENTER, CTRL-H 
  30. (deletes to left), CTRL-(^)M, ^J, ^U, and ^P itself (in a macro an 
  31. underscore is ^P^Ps; a left-delete is encoded ^P^H).  And since ^F 
  32. is used in VDE to put the current path and filename into the 
  33. macro, you need to indicate a word-to-the-right jump with ^P^F.  
  34. The other control characters (^E, ^R, ^K, ^Q, ^O, etc.)(unlike 
  35. Wordstar) can simply be put in straight.  CTRL-<letter> will show 
  36. up on the macro line as the letter, highlighted.  ESC can also be 
  37. put in straight, and will appear in the macro as a highlighted [, 
  38. but it can only be used for special purposes (including, as the 
  39. last element in a macro, jumping to another macro).
  40.  
  41. Once the first new macro is entered, it is in memory for the rest 
  42. of that VDE session, even if you do not store it to a key, and you 
  43. can call it up with ESC ].  Each time that you do, you will be 
  44. prompted to Use it or to Save it to a key.   If you do not save it 
  45. to a key, the next macro you create and Use will overwrite it in 
  46. memory, and ESC ] will only invoke the new one.
  47.  
  48. When you stop making your macro, with ESC " or with ENTER, VDE 
  49. will prompt you:  Use now, or Save to key?  If you choose S it 
  50. will prompt you for a key 0...Z.  In either case it will then 
  51. prompt you for Make Quiet, No-repeat, or Both?  A quiet macro will 
  52. not show you its work, and will run appreciably faster, but if the 
  53. macro has a command in it that asks you for input, you will not 
  54. see the prompt.  A no-repeat macro will run exactly once per 
  55. invocation, and it will not ask you how many times you want it to 
  56. repeat.  'Both' sets both of those conditions.  If you do not 
  57. specify N or B, the macro will ask:  Repeat count (0-254)/*?  A 
  58. count will cause the macro to run exactly that many times; a *, 
  59. until an error condition stops it.   VDE will usually stop on an 
  60. error condition when it reaches the end of the file.
  61.  
  62. For example, a very simple macro would consist of CTRL-B, Used 
  63. immediately, specified Quiet, and with * for the count:
  64.  
  65.                  ESC [ ^B ENTER U Q * ENTER
  66.  
  67. This would reformat your document to the end.  (You would only 
  68. need this if you had installed VDE not to reformat automatically.)
  69.  
  70. A macro that you would probably like to store would be one that 
  71. marks a whole word as a block:
  72.  
  73.           ESC [ ^D^A^Kb^P^F^SKk ENTER S B 0 ENTER
  74.  
  75. This would make sure you were in the word (^D), move left to the 
  76. front of it (^A), mark the block beginning (^Kb), jump to the 
  77. beginning of the next word (^P^F), back up one space (^S), mark 
  78. the end of the block (^Kk), close the macro (ENTER), save it to a 
  79. key (S), specify it as both quiet and one-shot (B), assign it to 
  80. key 0 (0), and end (ENTER).  Again, ^F calls in the current file 
  81. name into the macro, so it needs a ^P to make it literal.
  82.  
  83. At this point the macro is in memory, but it will disappear when 
  84. VDE is next closed.  The third element in making a macro is saving 
  85. it in a macro library file.  To do this conveniently, you have to 
  86. think ahead a little.  If you already have a macro library file 
  87. called, say, macros1.vdk, you can add your new macro to it.  But 
  88. first, macros1 has to be in memory when you make the new macro.  
  89. To do this, if you didn't call it up with VDE when you opened the 
  90. text file, you can type ALT-U.  You will be prompted 'Load or Save 
  91. .VDx file?' (.VDK is a regular-key, .VDF is a function- key, .VDG 
  92. is a graphics-character, and .VDP is a printer-driver file.)  You 
  93. would type '<PATH>macros1.vdk' ENTER, and macros1.vdk would be in 
  94. memory.  Only then would you create the new macro and assign it to 
  95. a key (you have to know what keys are already used up in 
  96. macros1.vdk, which we will discuss later---if you add the new 
  97. macro to an already-used key it will overwrite the existing 
  98. macro).  If you then save macros1.vdk, again with ALT-U, the new 
  99. macro will be in your library file.  If you don't save macros1 
  100. before you get out of VDE, the new macro will be lost.  Of course, 
  101. some macros you don't want to save.