Macros are a sophisticated and powerful tool for automating repetitive
tasks. A "macro" is a string of VDE commands and/or text that you can type in
once and then have repeated automatically. (Note: for large pieces of boiler-
plate text, read in disk files with ^KR instead.) A "function key" is a macro
assigned to one of the [F1]...[F40] keys, while a "macro key" is a macro
assigned to a key Esc0...9 or EscA...Z; these can all be defined either while
editing, or with VINSTALL. "Macro programming" involves the use of special
commands allowing a macro to perform more complex operations including loops
and conditional execution, much like a programming language.
VDE's 76 user-definable macros allow you to customize it for any task,
such as the formatting requirements of specialized professional writing, or
many programming languages. Many examples are given below.
To create a macro, while editing, you can:
(1) use the Esc[ command, and type the necessary keystrokes at the
prompt. You may want to plan or compose the macro first, using pen and
paper. Certain keystrokes, like [Ret] or ^X, are line editing commands,
and must be preceded by a ^P to enter them into the macro; the input line
has a 65-key limit. See MACROS, PROMPTS.
(2) use the Esc" command. Type the desired keystrokes, exactly as
you would while editing: no ^P prefixes are required, and you will see the
results as you type. There is a 128-key limit. See RECORDING MACROS.
Macros execute EXACTLY as though you had typed the given keys yourself.
EXAMPLE: to read in a letterhead file called LETTER.HDR at the top of your
file, you would type:
^QR to get to the top of the file
^KR to read in a file
LETTER.HDR to specify filename at the "Read file:" prompt
[Ret] to end the filename input
So this is exactly what you need to enter in your macro. Note that ALL the
input -- every keystroke, including answers to prompts, [Ret] keystrokes, and
so on -- MUST be included. For further details see MACROS.
Once again, ordinarily macros are completely self-contained, and NEVER
request input from the keyboard while running. There are two exceptions:
(1) If a reformat (^B) operation is in progress and
dehyphenation is required, the "Remove?" prompt will appear in
the header and a "Y/N" answer will be necessary to continue.
(This is a decision the macro can't make.) See REFORMAT.
(2) Using the AltR command in macros is tricky: input while
running a program must come from the keyboard. (At that point
VDE is no longer in control.) See RUN COMMAND.
USING MACROS
FUNCTION KEYS ([F1]...[F40]) - Up to 40 macros can be assigned to function
keys; they can then be recalled and used with one keystroke. Each of the
10 function keys can be used with Shift, Ctrl, or Alt, to produce:
Shift-[F1]...[F10] = [F11]...[F20]
Ctrl-[F1]...[F10] = [F21]...[F30]
Alt-[F1]...[F10] = [F31]...[F40]
The new Extended (101-key) keyboards actually have extra keys labeled
[F11] and [F12]; VDE will not recognize these keys.
Otherwise, function keys are defined (with the Esc] command, or with
VINSTALL) and used exactly like macro keys. See MACRO KEYS.
KEY DEFINITION FILES (AltU) - These files save sets of macro key or function
key definitions, and should be given file types of ".VDK" and ".VDF",
respectively. You can load any key file, along with your text file to
edit, from the command line (see SYNTAX). In addition, they can be loaded
or saved with the AltU command while editing in VDE, and can also be
created or installed as defaults in your copy of VDE with the VINSTALL
program (see below).
The AltU command will ask whether you want to "L"oad or "S"ave such a
file, then prompt for the name of the file. The filetype MUST be ".VDK"
or ".VDF", and will determine whether MACRO or FUNCTION keys are affected.
If you load such a file, those definitions will replace any previous ones.
If you save, the current definitions will be written to the file.
MACROS (Esc[) - When you are in the middle of doing something in VDE, and
find that you need to do something many times, it may be less tedious to
have it repeated automatically. If you type Esc[ you will be asked for
the string to execute, then a "Repeat count". Usually you will simply
type a number for the repeat count (0-254, or "*" for indefinite). You
will see the results as the macro executes, and you can abort i⇧נÄ⇧נÄéO≡pננננüé✓OîéP892¨¨œÃ3É"¨õù╱à⓪⓪⓪⓪⓪⓪⓪⓪⓪④,ôÉ1ãÃ⓪9Õ2ØØ⓪:Õ⓪6ãõ¨7É2¶2õ´´4ÃÃ⓪1<É9Õ2õœø<œãD'µC⇧⇦µgij⇦ג gijIJ⇨ג'°8gτττµ@C&gהD⇦@⇩D'ijIJג'אD⇨ג◆τה@αgτז@IJ'ijIJג'IJג◆⇦ג⇩gij⇧ijτהD'ij⇨גוג⇦τו⇩'ijIJג'°8gτττij◆╱⇩@'א@B gτכijdτגij'ijIJIJ⇩'IJ⇦gijIJג'ij◆╱⇩@'הFij⇦ג⇩'הA'אD⇨⇦⇩IJD'ij⇩⇦⇩gIJCijτ°8gτττα 'ijIJג'ijD╱⇦⇩⇩◆⇩A'בא@⇨ijא'ijגτij@τגIJ⇩⇨ijו⇧'!88gττττττττז◆╱⇩@⇩'וא'אij⇨τוA'ijIJ⇦'וgג⇩B@⇩gij╱╱⇩B 'ijIJג'ג⇩B@⇩gij⇦⇩⇩◆⇦⇦'ij⇧ijτהD'°8gτττijA⇩⇧╱@ג τוDτה◆gהD'ה AltG Y
will enter one character. You can get a line 40 characters long by giving
a repeat count of "^Q40" (the "^Q"uiet option avoids unnecessarily
displaying the menu).
4. Can you figure out what this one does, if entered with a repeat
count of "*"? (Answer: .elif eht fo dne eht ta meht fo tsil a gnikam
elif a fo tuo sesehtnerap ni stnemmoc ekat lliw tI)
^QR ^QF(^J ^G ^KB ^QF)^J ^G ^KK ^QC [Ret] ^KV
VDE macros are very powerful tools, particularly given their program
ability and storage on macro Keys.
MACRO KEYS (Esc],0...Z) - Up to 36 macros can be stored (0...9,A...Z), by
entering them with the Esc[ command, then using Esc] to save them. They
can then be recalled and used with two keystrokes. Example: typing Esc]3
will store the last macro used as key 3, and it can be recalled and reused
at any future time simply by typing Esc3.
Ordinarily, macro keys operate just like the original macro: they
will ask for a "Repeat count" when executed. In many cases, you will want
a key to execute only once when invoked; you can make a key "No-repeat" by
typing ^N before the keycode. Example: Esc]^N3 stores a macro to key 3 as
a non-repeating sequence. If you want the key to run in Quiet mode as
well (to increase speed and minimize display activity), you can instead
type ^Q: Esc]^Q3 stores a quiet, non-repeating sequence.
Using a defined key brings its definition into the macro buffer
(whence it can be stored again, if desired). Trying to use an undefined
key results in an error. You can delete a key definition by entering an
empty macro string (Esc[, return) and storing it to the key.
There is a total of 982 bytes available for all 36 keys, and a 128
byte limit for any one key. (VDE's own input line will only accept 65
bytes, but VINSTALL can handle up to the full 128.)
EXAMPLES: Besides simply storing any macro, these Keys are useful for
storing a frequently repeated phrase; "EscW" is much more convenient than
"World Wide Widgets Ltd. (N.A.)". You might also define one as a common
command like ^PS, for underlining; or a set of margins, like ^OR60[Ret]
^OL5[Ret]. A key defined as ^QR ^N AltD ^OF would place the current date
at the top right of a letter.
Keys defined with Esc] are of course temporary. (VINSTALL allows you
to install them permanently; see DEFAULT FUNCTION KEYS.)
MACRO PROGRAMMING (Esc0...Z,!,=,~,(),+,-,&,;) - VDE has several commands that
operate only in a macro string, and give you conditional control over the
execution of a macro, allowing real programming.
Esc0...Z, when in a macro, function simply as "labels" 0...Z. They
have no effect, but can be "jumped" to by other commands.
Esc! followed by 0...Z is a simple "jump" instruction, causing macro
execution to resume with the command following the label Esc0...Z.
Example: Esc!2 jumps to label 2. As two special cases, Esc![ jumps to the
beginning of the macro, and Esc!] jumps to the end (aborts).
Esc= and Esc~, followed by a character and then a label 0...Z (or
"[","]"), are conditional jumps: they jump to that label IF the character
at the cursor position does (or for "~", doesn't) match that specified.
Example: Esc~^M2 jumps to label 2 if the current character is NOT a CR.
Esc= and Esc~, followed by a character and then ">" or "<", are
search loops. They will continue to move the cursor right (or for "<",
left) as long as the character at the cursor does (or for "~", doesn't)
match, or until the beginning or end of the file. Example: Esc=_> moves
right as long as the current character is a space.
Several commands allow the use of a counter variable. Esc() sets
the value: for example, Esc(0) initializes it to zero. The Esc+ command
simply increments the value; Esc- (that's Esc,minus) decrements the value,
then jumps if it is zero to a specified label. (In addition to a number,
you may use "[" or "]" for the start or end of the macro, or "@" to avoid
jumping entirely.) Example: Esc-] decrements the counter, jumping to the
end (exiting) if it reaches zero.
Esc&, followed by 0...Z, is used to "chain" to another macro key. In
this way you can build up strings longer than the 65/128-byte limit on any
one key. It does not "call" the key; there is no returning. Example:
Esc&M chains to key M.
Esc; (semicolon) gives a brief pause before execution continues,
presumably so the user can see what's happening on screen.
Macro programs are stored just like any other macro string (usually
as No-repeat). If you program an endless loop, you will at some point
have to abort by pressing Esc. Don't make macro programs Quiet until
you're sure they work.
EXAMPLE 1: here is a good macro program (best stored as a Quiet key)
to move the cursor to the start of the current sentence:
Esc~.1 ^S Esc1 Esc~.< Esc2 ^D Esc=_2 Esc=^M2
You could write this out in programmer's pseudo-code as:
If not "." goto label1
Move left ;move left if already on period
label1: While not "." move left ;move left to previous period
label2: Move right ;now move back right
If " " goto label2 ; as long as you see a space
If "^M" goto label2 ; or a Return
(all done)
EXAMPLE 2: a macro to move to the start of the current paragraph:
^QS ^S^S Esc=_[ ^D^D
EXAMPLE 3: a macro to delete a word to the LEFT of the cursor:
^S Esc~_2 Esc1 ^G^S Esc=_1 Esc2 ^G^S Esc~_2 ^D
EXAMPLE 4: a macro to match parentheses. Many programming languages
use nested sets of parentheses, for example "{}" in C. This program, when
the cursor is placed on an open bracket, will move ahead to find the
closed bracket that matches it:
Esc~{] Esc(0) Esc1 Esc~{2 Esc+ Esc!3
Esc2 Esc~}3 Esc-]
Esc3 ^D Esc!1
EXERCISE: suppose you have a file captured from an online session
with a remote system. You corrected a lot of "misteaks" as you typed,
using the Backspace key -- and now that's all in the file:
I hardly ever make misteak^H^H^Hakes!
Write a macro program to go through the file and neaten those all up,
deleting the erased characters along with the ^H's.
RECORDING MACROS (Esc") - As an alternative to composing macros and using the
Esc[ command to type them in, you can simply record a macro from a
sequence of keystrokes as you go about a task. Press Esc" to activate
recording; type away; then press Esc" again to conclude. You will then be
asked for the repeat count, etc (see MACROS). No confusing ^P prefixes
are needed, and you can take advantage/Ç✓נüâêOêÇ⇧üנהDבij✓⇩Oüêê⇧âנüé⇩⇧ijננ≡pננננÇ⇨é⇧êOäê⇦ëéêAנÄOå⇧êOÇ⇦ÇOבכאOÇ⇩⇧üנîêOÇé⇦⇩üêOéנüâêOÇ◆çê⇦נäé✓⇨üנ≡pננננבçäê✓é⇨אOÄ⇦êOÇ✓נüâêOâê ê⇦IJנé✓נüâêOâê ê⇦נé⇦Oëé⇦◆üÄ⇩✓ ij≡pנננננננננÉÇ⇧ê@נêÇî⇧éנÄëנÇ⇦ÇOÇ✓⇩OîëäOÇ⇩⇧üנÇÇ⇧נÇ⇦ÇOÇ⇨é⇧êOÇ⇦ÇO≡pננננäê⇦ëéêOé⇦OéנçäÇ✓⇦ê⇦⇦@≡p±≡p≡pij@@@@@@@@@@@@@@@@@@@@@@@@@Oנij@נäÇ⓪ÉÆ⓪ÿOÇÆ⓪ä⇧ß①æננij@@@@@@@@@@@@@@@@@@@@@@@@@@@@pp≡p≡pנננננÇÆ⓪ä⇧ß①æנé⇦OÄOÇ⇧é⇧é⇧r style CGA adapters).
An uninstalled copy of VDE will ask you whether it is running on an IBM
compatible computer. Once you have used VINSTALL this message will disappear.
Your copies of the program files will have names like VINST13.COM and
VDE13.COM. Feel free to rename these to VINSTALL and VDE, as will be assumed
here (or to VI and V, as I do). To run VINSTALL simply type:
name of a copy of VDE to modify:
C>vinstall if your copy is called "VDE.COM"
or C>vinstall FILENAME if it's called something else.
Notes: VINSTALL modifies the file VDE.COM; always keep an unmodified
original copy of all VDE files in case problems arise! The version numbers of
VINSTALL and VDE (and any auxiliary key or printer files, see below) must
agree, or you will get an error.
VINSTALL is fully menu-driven; it will present you with a set of
categories that corresponds to each section below, starting with Installation;
you select the values you want to change. The program is largely self-
documenting, and steps you through each item individually. If this is your
first time, take advantage of its "Help" option before you start in, for some
basic instructions. You may also find a good ASCII chart helpful. VINSTALL
uses several different types of data entry:
TEXT - Just type in the character(s).
LOGICAL - Yes/No. Just type "Y" or "N".
DECIMAL - Enter a number from 0 to 255.
HEX - Enter a two-digit hex byte value 00-FF. (Don't omit lead zeros.)
BYTE STRINGS - fixed length: enter the required number of hex bytes.
variable: enter the (hex) count for the number of bytes,
followed by the bytes themselves. Example: (02)1B3D. The max-
imum length is given in square brackets [#]. This format is
referred to below as "(#),bytes".
VINSTALL can't check for illegal values; be careful what you enter!
At most points in VINSTALL, you can press Esc to return immediately to
the Main Menu, or ^C to abort the program.
----------------------------- A. INSTALLATION ------------------------------
When you run VINSTALL on an uninstalled copy of VDE, this selection will
be made automatically. You must describe the computer you are using: whether
100% IBM PC compatible, or not. (The HP Portable Plus is also supported.)
The IBM PC installation gives the best performance, but requires an IBM
standard BIOS and a supported video adapter (MDA,CGA,EGA,VGA). You can
customize the display (colors, fonts etc) to your preferences.
The non-IBM installation will run on any system that supports ANSI
standard screen control sequences (eg, the ANSI.SYS screen driver -- you must
have the statement DEVICE=ANSI.SYS or equivalent in your CONFIG.SYS file).
You must also specify the size of your screen. This installation can of
course be used on IBM compatibles, in the event that direct video access is
undesirable. It will even work in "remote" applications, such as high-speed
modem connections, with appropriate terminal software on the user's end.
COMMON PARAMETERS:
Clock speed in MHz - Set this decimal value to reflect your CPU clock speed.
Common values are 5 (for 4.77), 8, 10, 12, etc. Adjust the value if
desired to change the length of delays in VDE. (At present this involves
only the "Esc;" macro command.)
IBM PC PARAMETERS:
Screen colors - you can select six video attribute bytes: one for normal text;
one for block text; one for soft CR markers; one for the header; one for
menus and prompts; and one for highlights (prompts, etc). Each is two hex
digits, for a background and foreground color. You will see a color
palette displayed on screen; the color digits are:
*0 = BLACK 4 = red *8 = GREY C = lt red
1 = blue 5 = magenta 9 = lt blue D = lt magenta
2 = green 6 = brown A = lt green E = yellow
3 = cyan *7 = WHITE B = lt cyan *F = BRIGHT WHITE
(* - All monochrome screens can display BLACK, WHITE, and BRIGHT WHITE; in
some cases, GREY may also be visible.)
Any digit may be used for the the foreground, but only 0-7 for
background (8-F produce blinking video... ugh). You will probably want
the header and highlight attributes to have the same background.
Use VDE font in EGA mode (Y/N) - When the AltE command is used to display 43
lines on an EGA (or 50 on VGA), you can choose one of two fonts. VDE's
own font is thinner than the ROM font, and you may find it more readable.
"Y" selects this font; "N" selects the standard (fat) ROM font.
Make cursor "D"efault,"B"lock,"U"nderline (D/B/U) - You can choose the cursor
type you want during editing. Choose "D"efault to leave it whatever it
types of .COM or .EXE) will not show in the ^KF directory display (unless
the filetype is specified explicitly), and cannot be edited. This is a
protection feature; you can damage such files by trying to edit them. To
disable, set to "@כו╱à#4À2É6ÃØ2É④+ùáùº④É⑥É⓪+œ4õœ⓪7ø⓪:42É:492ØÉ34À2É6ÃØ2¨É① æ⑥①+æ⑥①'①⓪22¨õ¨4õ2Ø⓪4Ã⓪╱à⓪⓪⓪⓪+""ù"'íÉ27É<ôÉ;ãÃ:⓪0¨É:42É22ø0´À:É⓪④'¨4øœÃ0À6<É① æ⑦④åà ´´7É6ÃØ2É9ØÀ2õ´⓪34À2´<Õ2¨É⑥É,ôÉ1ãÃ⓪9Õ2õœø<É37´¨⓪34À2´<Õ2¨É④7¨⓪:<Õ2É6㨌¨û⓪╱à⓪⓪⓪⓪:¨œÃ3É①æ⓪;œÀ21ã¨29ò'ו⇩'ג⇧ה⇦⇨ijIJB'ijij'ijIJג'ו╱@D'גג⇦Gijαgג@⇩gג⇧ו⇨ijג τIJ'°8gτττהגτגג╱ו⇩D'וijτµ`O⇩✓&gגAג⇩'ijij'גג⇦Gijτוij◆IJ╱◆ijIJ'ijij'µHfgij⇦ג τij⇩g°8gτττו or C>vinstall FILENAME if it's called something else.
Notes: VINSTALL modifies the file VDE.COM; always keep an unmodified
original copy of all VDE files in case problems arise! The version numbers of
VINSTALL and VDE (and any auxiliary key or printer files, see below) must
agree, or you will get an error.
VINSTALL is fully menu-driven; it will present you with a set of
categories that corresponds to each section below, starting with Installation;
you select the values you want to change. The program is largely self-
documenting, and steps you through each item individually. If this is your
first time, take advantage of its "Help" option before you start in, for some
basic instructions. You may also find a good ASCII chart helpful. VINSTALL
uses several different types of data entry:
TEXT - Just type in the character(s).
LOGICAL - Yes/No. Just type "Y" or "N".
DECIMAL - Enter a number from 0 to 255.
HEX - Enter a two-digit hex byte value 00-FF. (Don't omit lead zeros.)
BYTE STRINGS - fixed length: enter the required number of hex bytes.
variable: enter the (hex) count for the number of bytes,
followed by the bytes themselves. Example: (02)1B3D. The max-
imum length is given in square brackets [#]. This format is
referred to below as "(#),bytes".
VINSTALL can't check for illegal values; be careful what you enter!
At most points in VINSTALL, you can press Esc to return immediately to
the Main Menu, or ^C to abort the program.
----------------------------- A. INSTALLATION ------------------------------
When you run VINSTALL on an uninstalled copy of VDE, this selection will
be made automatically. You must describe the computer you are using: whether
100% IBM PC compatible, or not. (The HP Portable Plus is also supported.)
The IBM PC installation gives the best performance, but requires an IBM
standard BIOS and a supported video adapter (MDA,CGA,EGA,VGA). You can
customize the display (colors, fonts etc) to your preferences.
The non-IBM installation will run on any system that supports ANSI
standard screen control sequences (eg, the ANSI.SYS screen driver -- you must
have the statement DEVICE=ANSI.SYS or equivalent in your CONFIG.SYS file).
You must also specify the size of your screen. This installation can of
course be used on IBM compatibles, in the event that direct video access is
undesirable. It will even work in "remote" applications, such as high-speed
modem connections, with appropriate terminal software on the user's end.
COMMON PARAMETERS:
Clock speed in MHz - Set this decimal value to reflect your CPU clock speed.
Common values are 5 (for 4.77), 8, 10, 12, etc. Adjust the value if
desired to change the length of delays in VDE. (At present this involves
only the "Esc;" macro command.)
IBM PC PARAMETERS:
Screen colors - you can select six video attribute bytes: one for normal text;
one for block text; one for soft CR markers; one for the header; one for
menus and prompts; and one for highlights (prompts, etc). Each is two hex
digits, for a background and foreground color. You will see a color
palette displayed on screen; the color digits are:
*0 = BLACK 4 = red *8 = GREY C = lt red
1 = blue 5 = magenta 9 = lt blue D = lt magenta
2 = green 6 = brown A = lt green E = yellow
3 = cyan *7 = WHITE B = lt cyan *F = BRIGHT WHITE
(* - All monochrome screens can display BLACK, WHITE, and BRIGHT WHITE; in
some cases, GREY may also be visible.)
Any digit may be used for the the foreground, but only 0-7 for
background (8-F produce blinking video... ugh). You will probably want
the header and highlight attributes to have the same background.
Use VDE font in EGA mode (Y/N) - When the AltE command is used to display 43
lines on an EGA (or 50 on VGA), you can choose one of two fonts. VDE's
own font is thinner than the ROM font, and you may find it more readable.
"Y" selects this font; "N" selects the standard (fat) ROM font.
Make cursor "D"efault,"B"lock,"U"nderline (D/B/U) - You can choose the cursor
type you want during editing. Choose "D"efault to leave it whatever it