
|
- Written and documented by David Deley
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12.1: 12.2: 12.3: 12.4:
Introduction to CMac Chapter 6: Command Map Report
A great way to learn about CMAC is to examine some real code. The Multi-Edit\src folder (e.g. C:\Program Files\Multi-Edit 9.10\src) contains all the CMAC macro source code for Multi-Edit. (NOTE: If you do not have a \src folder under Multi-Edit then you need to reinstall Multi-Edit and check the box "Macro Source". See http://www.multiedit.com/forums/viewtopic.php?p=1380#1380))
INSIDE MULTI-EDIT
Here is a condensed sample output:
This tells us the "Open File" command is assigned to key F3, and it
runs macro "LoadFile" passing the parameter "/E=1". Unfortun ately it
doesn't tell us which file in the Multi-Edit\src folder has the
"LoadFile" code. (Depending on what version of Multi-Edit you have,
it's either in the file "MeUtil1.s" or in file "MeUtil.s")
One way to find a macro is to do a SEARCH -> FILE FIND and search
all the "*.s" files in the Multi-Edit\src folder for the string
"LoadFile", and then wade through the results to find where it's
defined. A second more refined way is to use regular expressions. Classic:
or Unix style:
For more on regular expressions click the "Alias" button to see a vast array of predefined regular expressions ready for you to use, such as the <b1> used above. A third way is to use the Multi-Edit "tags" feature, which I'll describe in a future post. (See http://www.multieditsoftware.com/forums/viewtopic.php?t=401) The Command Map Report is a gold mine of information about how Multi-Edit works, and what macros are available for you to use.
(Note 1: http://www.multiedit.com/downloads/windows/macros/showcmd.zip contains macro showkeys, which will create a command map sorted by key name, and macro showcmds, which will create a command map sorted by command name.)
MULTI-EDIT KEYS/COMMANDS
Go to TOOLS -> CUSTOMIZE, set the left side to "General" (at the top):
Click on the "Keys/Commands..." button. Then scroll down to the "File Operations" section and highlight the line "Open file":
Click on the "Edit" button (top right):
< This tells us the command name is "Open File", it's a macro, the run macro command line is once again "LoadFile /E=1", and that function key F3 is assigned to this macro.
NOTE: You change the primary or secondary key by clicking on the
You can add your own user defined macros to the "Command Mapping"
window (above). There's a section near the bottom titled "User-defined
Operations" specifically for you. Just highlight a line where you want
the new command to be inserted and click "Insert".
MULTI-EDIT MENUS
Go to TOOLS -> CUSTOMIZE, set the left side to "General" (as before), click on the "Menus..." button.
Highlight "Main" and click on the "Edit" button (top right side).
Highlight "Open" under "File", then click on the "Edit" button (top
right side) and we'll have a look at what the Multi-Edit FILE ->
OPEN menu item does.
For more information see the topic "Modifying a Command Map" in the Multi-Edit help (HELP->CONTENTS, or F1 key). RELATED ARTICLE: Introduction to CMAC: 11. Defining a key to run a macro
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12.1: 12.2: 12.3: 12.4: |