|
- 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 5: DebugLog
Another useful debugging tool is DebugLog:
| Code: |
#include Win32.sh //Must come before #include MsgLog.sh
//(defines struct TMsg used by MsgLog.sh)
#include MsgLog.sh //DebugLog is defined here.
void testdebuglog()
{
DebugLog(2, "TestDebugLog", "Hello World" );
}
|
This will create a window named "MSG-2.LOG" and place your output in
that window. (The file MSG-2.LOG will be stored in your current working
directory.)
NOTE: the second parameter (currently "TestDebugLog") is limited to
32 characters. The second parameter is usually used to give the name of
the macro. The third parameter (currently "Hello World") is limited to
2048 characters. This is where you may put whatever string you want to
log.
DebugLog is a macro defined in file MsgLog.s in the Multi-Edit\src
folder (e.g. C:\Program Files\Multi-Edit 9.10\src). You may view that
file to learn more about DebugLog. (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)
Example 2:
| Code: |
#include Win32.sh //struct TMsg used by MsgLog.sh is defined here.
//#include Win32.sh must come before #include MsgLog.sh !
#include MsgLog.sh //DebugLog is defined here. Macro is in MsgLog.s
void testdebuglog()
{
int i = 12;
int j = 0x5A7A;
real pi=3.14159265358;
str hi='Hello World';
DebugLog(2, "TestDebugLog",
'i=' + str(i) +
' j=0x' + hex_str(j) +
' pi=' + Rstr(pi,7,4) +
' hi="' + hi + '"' );
}
|
For advanced Multi-Edit debugging techniques see the article Understanding Multi-Edit's Trace Facility at http://www.multieditsoftware.com/trace_facility.php
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12.1:
12.2:
12.3:
12.4:
|