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
Wrap
Text File
|
1992-06-14
|
6KB
|
101 lines
A macro is a set of characters or a set of commands that is called
up by a single command. In VDE there are two main kinds:
regular-key and function-key commands The two types largely work
the same, but they are loaded separately, as .vdk or as .vdf
library files. There are 36 regular-key macros: ESC 0 - ESC 9
and ESC A - ESC Z; jointly referred to as ESC 0...Z. They are
called up by striking the escape key, followed by the letter or
number (top row) key. A function-key macro is invoked by striking
a function key, alone or with ALT, SHIFT, or CTRL depressed; there
are thus 40 of these (48 if your keyboard has function keys 1-12).
To get access to a macro you must either create it on the spot or
have loaded it from a macro file.
Macros in VDE can be very simple---or very complex. They can be
created by writing on the macro dialog line or by recording. A
recorded macro is made by turning on the record function (with ESC
"), carrying out the set of commands, and toggling the recorder
off (ESC "). As you record, you see the effects of the commands,
so you can see what the macro is going to do.
The other way is to strike ESC [ and enter the macro codes on a
dialog line. This way is good for both very simple macros that
you can bang in without thinking and for macros so complex that
you have to work them out on paper first. An ENTER ends this kind
of macro.
When you enter a macro on the dialog line, you have to keep one or
two things in mind. Some keys are used to edit or terminate the
macro, and these keys must be preceded by a CTRL-P: ENTER, CTRL-H
(deletes to left), CTRL-(^)M, ^J, ^U, and ^P itself (in a macro an
underscore is ^P^Ps; a left-delete is encoded ^P^H). And since ^F
is used in VDE to put the current path and filename into the
macro, you need to indicate a word-to-the-right jump with ^P^F.
The other control characters (^E, ^R, ^K, ^Q, ^O, etc.)(unlike
Wordstar) can simply be put in straight. CTRL-<letter> will show
up on the macro line as the letter, highlighted. ESC can also be
put in straight, and will appear in the macro as a highlighted [,
but it can only be used for special purposes (including, as the
last element in a macro, jumping to another macro).
Once the first new macro is entered, it is in memory for the rest
of that VDE session, even if you do not store it to a key, and you
can call it up with ESC ]. Each time that you do, you will be
prompted to Use it or to Save it to a key. If you do not save it
to a key, the next macro you create and Use will overwrite it in
memory, and ESC ] will only invoke the new one.
When you stop making your macro, with ESC " or with ENTER, VDE
will prompt you: Use now, or Save to key? If you choose S it
will prompt you for a key 0...Z. In either case it will then
prompt you for Make Quiet, No-repeat, or Both? A quiet macro will
not show you its work, and will run appreciably faster, but if the
macro has a command in it that asks you for input, you will not
see the prompt. A no-repeat macro will run exactly once per
invocation, and it will not ask you how many times you want it to
repeat. 'Both' sets both of those conditions. If you do not
specify N or B, the macro will ask: Repeat count (0-254)/*? A
count will cause the macro to run exactly that many times; a *,
until an error condition stops it. VDE will usually stop on an
error condition when it reaches the end of the file.
For example, a very simple macro would consist of CTRL-B, Used
immediately, specified Quiet, and with * for the count:
ESC [ ^B ENTER U Q * ENTER
This would reformat your document to the end. (You would only
need this if you had installed VDE not to reformat automatically.)
A macro that you would probably like to store would be one that
marks a whole word as a block:
ESC [ ^D^A^Kb^P^F^SKk ENTER S B 0 ENTER
This would make sure you were in the word (^D), move left to the
front of it (^A), mark the block beginning (^Kb), jump to the
beginning of the next word (^P^F), back up one space (^S), mark
the end of the block (^Kk), close the macro (ENTER), save it to a
key (S), specify it as both quiet and one-shot (B), assign it to
key 0 (0), and end (ENTER). Again, ^F calls in the current file
name into the macro, so it needs a ^P to make it literal.
At this point the macro is in memory, but it will disappear when
VDE is next closed. The third element in making a macro is saving
it in a macro library file. To do this conveniently, you have to
think ahead a little. If you already have a macro library file
called, say, macros1.vdk, you can add your new macro to it. But
first, macros1 has to be in memory when you make the new macro.
To do this, if you didn't call it up with VDE when you opened the
text file, you can type ALT-U. You will be prompted 'Load or Save
.VDx file?' (.VDK is a regular-key, .VDF is a function- key, .VDG
is a graphics-character, and .VDP is a printer-driver file.) You
would type '<PATH>macros1.vdk' ENTER, and macros1.vdk would be in
memory. Only then would you create the new macro and assign it to
a key (you have to know what keys are already used up in
macros1.vdk, which we will discuss later---if you add the new
macro to an already-used key it will overwrite the existing
macro). If you then save macros1.vdk, again with ALT-U, the new
macro will be in your library file. If you don't save macros1
before you get out of VDE, the new macro will be lost. Of course,
some macros you don't want to save.