" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008000" VLINK="004000" ALINK="#00C000">
Macrogenerator
Sometimes, you have to repeatedly enter the same sequence of commands.
It is tedious and time consuming. The remedy is to use CP's macro definition
feature. This feature allows you to ascribe a certain sequence of commands
to a one- or two-key combinations. Once you have defined the sequence, there
is no need to repeat these entries. Just press the assigned key combination
to obtain the same result. Let's take, for example, that you constantly move
from one disk to another. To do this, you have to press first [Ctrl-D] and
then the letter of the disk, e.g. [C]. Now, by defining a macro consisting
of a string of commands [Ctrl-C][C] and the [Alt-C] name, to do the
switching to the C: disk, just press [Alt-C].
To enter the macrogenerator mode do one of the following:
1) Select the "Other" item in the pull-down menu and the "Setup" item in
the submenu and then the "Macrogenerator" item.
2) Press [Ctrl-S] and [M].
+--------------------------------------------------------------------+
| Macro Generator 4:23pm |
+--------------------------------------------------------------------+
| Macro: 1 of 12 , key: 1 of 1 I CP.MAC size: 134 bytes. |
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
| Macro : Macro extension |
| definition : |
| Alt-F1 : ^D |
| Alt-A : ^D "a" |
| Alt-B : ^D "b" |
| Alt-C : ^D "c" |
| Alt-D : ^D "d" |
| Alt-E : ^D "e" |
| Alt-F : ^D "f" |
| Alt-G : ^D "g" |
| <New> : |
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
| <F1> - Help ... (C) PhysTech Soft Ltd. 1991-1996. |
+------------------------------------------------------------[126K]--+
Creating macrodefinitions
To create a new macrodefinition point the cursor at the <New> item and
press [Enter] or left button of a mouse.
You will now see the following message at the bottom of the screen:
+-----------------------------------------------------+
| Enter a new macro key or strike ^Space for special. |
+-----------------------------------------------------+
Press a key, or a combination of those, which will activate the
macrodefinition. Any key or a combination of any alphanumeric keys with one
of the following: [Ctrl], [Alt], [Shift] keys can be used (as the above
example used the [Alt-C] combination.
If the key is already in use, you will receive the corresponding
message: "Macro key already used". In such a case you will need to re-enter
another name for a macro.
Your entered key combination [Alt-C] will appear in place of the
<New> field. After this you can enter the keys constituting the macro's
body, which is called the macroextension. To do this:
1) Press [Tab] to make the pointer move to the macroextension field
2) Press [Enter]
Using a mouse:
1) Click twice the left button at the first macroextension field of your
chosen macro.
You will then receive the following message:
+------------------------------------------------------+
| Enter macro extension and strike ^Space for special. |
+------------------------------------------------------+
Press keys, which form the macrodefinition (in our example,
[Ctrl-D],[C]. When doing so, the pointer will move to the next
macroextension field, while the previous field will show the entered keys.
As a part of the macrodefinition you can use left, right button of a
mouse and "user input". To do so, press [Ctrl-[Space]] and choose the
desired.
When all is done, press [Ctrl-[Space]]. You will then receive the
following message:
+-----------------------------------------------+
| Macro extension special |
| Select special option: |
| Done Left mouse Right mouse User input |
+-----------------------------------------------+
Choose [D] for "Done". Your macro is now ready.
Exiting the macrogenerator
Hit [Esc] to exit the macrogenerator. You will receive the following
message:
+-----------------------------------------------+
| Save the latest changes? |
| Save Don't save Back to macro generator |
+-----------------------------------------------+
Choose [S] for "Save" to save your new macro.
Editing previously created macros
Enter the macrogenerator mode ([Ctrl-S] and [M]). Then select the
desired macrodefinition and press [Tab], or if using a mouse, press left
button and [Tab]. To delete some part of a definition, select the place to
be deleted and press [Del]. If you need to make an insertion, do as
described in the "Creating macrodefinition" paragraph.
Deleting macrodefinition
Enter the macrogenerator ([Ctrl-S] and [M]). Then select the desired
macrodefinition and press [Del], or if using a mouse, press left button and
[Del].
Examples of macrodefinitions from macrodefinitions file:
Alt-F1 - Change drive of Panel A (=^D)
Alt-F2 - Change drive of Panel B (="P)
Alt-A - Change drive of Panel A for A:
Alt-B - Change drive of Panel A for B:
Alt-C - Change drive of Panel A for C:
Alt-D - Change drive of panel A for D:
Alt-E - Change drive of panel A for E:
Alt-F - Change drive of panel A for F:
Alt-G - Change drive of panel A for G:
F10 - Immediate exit from CP main menu.
Alt-F3 - View a tagged file by the built-in viewing program irrespective
of the file's extension.
Alt-P - Print the tagged file.
Alt-1 - Beginn packing tagged files. Press [Alt-F1], enter the archive
file name and press [Alt-2].
Alt-2 - Pack tagged files. Before pressing [Alt-2] press [Alt-1] and
enter the archive file name.
^] - Switch mini-help on/off
Alt-M - Switch monochrome mode on/off.
Some hints on using the macro commands
Note, that macrodefinitions created with the help of the macrogenerator
can work only inside the CP shell and if, as a result of a macro command,
you leave the CP shell the execution of the macro command will immediately
be halted. Be careful when defining the keystroke to assign a
macrodefinition to. If this keystroke is already reserved by CP itself you
can run into trouble. For example, assume that you decided to use [Esc] to
call your macro command that erases all files with extension .BAK from the
directory C:\MASM\LIB. Imagine that you've been editing a file with the CP
built-in editor. When you finish with editing you have to save the changes
made to the file and quit the editor. To do so you press [Esc] which is CP's
usual keystroke for the purpose. However, as you re-defined the keystroke,
it will be interpreted by CP as the macro definition call and CP will begin
to delete all files with the extension .BAK from the directory C:\MASM\LIB.
This means that you will be unable to save the changes in the files you were
editing, and you will not even be able to exit CP without rebooting.
It ought to be noted that although CP itself does not distinguish
between synonymous keys (e.g. [Tab] and [^I], [Enter] and [^M], it does
distinguish between them as macro call keys. In other words, you can create
macrodefinitions assigning the call function to [^M], while [Enter] will
continue to carry out its regular functions.