From the Support Desk
Getting Started on Your CMac Macro Contest Entry
- Clay Martin
Most folks that are thinking about entering a CMac macro in the contest are fairly familiar with CMac
code. But even if you are not, that should not stop you at all. If you are familiar with languages like C or Pascal, CMac
will be easy to pick up. Mind you, it does have some quirks, but a fine set of Tutorials by David Deley can get you going quickly. Even if you are an accomplished CMac
coder you may still find out some new tricks. Yes, you can look at the CMac sources, located in the Src directory under the installation
directory for examples on how to create dialogs, but it is much easier to check out David's tutorial.
These have been placed online in two places. The first is the Wiki:
http://wiki.multiedit.com/doku.php/doc/tutorial/CMac_0
Here you will find the list of tutorials, broken into categories. But if you are having trouble, you might check out the tutorials on the forum. They contain posts
from users having problems and post helping with those problems in addition to the basic tutorial. If you are having problems with the code in the tutorial, someone
may have had the same problem, and you can find the answer.
To locate the forum tutorials go to the Advanced Search on the forum: http://forums.multiedit.com/search.php Then enter in the Search for Keywords box: Introduction to CMac, then select the User Created Macros forum
and pick the radio button (below the forum selection) labeled: Topic titles Only. Then press the Search button. This will provide you a list of all the
tutorials, not in any order unfortunately.
Here is a list of the tutorial topics on the Wiki:
- Introduction to CMac: 01. Hello World
- Introduction to CMac: 02. Hello World II
- Introduction to CMac: 03. Caveats
- Introduction to CMac: 04. Make_Message
- Introduction to CMac: 05. DebugLog
- Introduction to CMac: 06. Command Map Report
- Introduction to CMac: 07. Multi-Edit Tags
- Introduction to CMac: 08. GetSystemTime & GetLocalTime
- Introduction to CMac: 09. Calling user-written dll
- Introduction to CMac: 10. Arrays and Structures
- Introduction to CMac: 11. Defining a key to run a macro
- Introduction to CMac: 12.1 DIALOG BOXES: The Elements
- Introduction to CMac: 12.2 DIALOG BOXES: The Coordinates
- Introduction to CMac: 12.3 DIALOG BOXES: Sample Code For Each Control
- Introduction to CMac: 12.4 DIALOG BOXES: DlgExecute
- Introduction to CMac: 12.5 DIALOG BOXES: Modeless Dialogs
- Introduction to CMac: 12.6 DIALOG BOXES: The ListBox
- Introduction to CMac: 12.7 DIALOG BOXES: Tab Bars
If you are moving from another language to CMac, David describes some of CMac's peculiarities in "Caveats."
If you are having problems with debugging your macro try the article "Make_Message" for a simple way to find out what's happening when your macro runs. If you need a
more sophisticated method of debugging, try "DebugLog" for a way to create an edit window with a running log of messages you placed in your code.
Often when creating our own macros we see something in an existing system macro that we want to put in ours. Keep in mind that the majority of Multi-Edit functionality is coded in CMac. Sometimes we will find that there is a system macro that has
functionality (like opening a file selection dialog) that we want. In either case we would need to have easy access to the code we wanted to emulate, or the macro
function called by that system macro. Dave provides an excellent example of how to index all the system macros so that it is easy to find the code you need in the
tutorial "Multi-Edit Tags" Much of the documentation of the system macros, like SaveFile are located in the comments above the code for
that macro. So you need to find the source code to see all the parameters you can pass, and what they can do for you. David's article makes easy work of this.
Whether you are a CMac pro or just starting with CMac, it's your unique idea that will get you the win.
Maybe you can see improved productivity with a new tool for the editor?
Maybe you can see an improvement to an existing editor tool? Here is your chance to shine among your peers and maybe win some loot. So get to work on your macro and
let the best ideas prevail. Here is the link to the official rules, and the prizes offered: http://www.multiedit.com/CMacContest2010.php
o As always, we at Multi-Edit are here to assist with any questions you might have including any CMac related questions. You can contact us using our website support forums (http://www.multieditsoftware.com/forums) or via email (support@multieditsoftware.com) .
Clay Martin, Technical Support
Multi Edit Software, Inc.
support@multieditsoftware.com
Input Your Suggestions in the Forum:
http://www.multiedit.com/forums/viewforum.php?f=7
**Please note that you can review/search
through all forum topics,
but to submit a post you must register on the forums.