Multi-Edit's Top Bar Image - Click here to Return to the Home Page spacer image for website layout News regarding our IDE -click this image- Products of MESI Page -click this image- Support Avenues, Forums, Emails etc. -click this image- Purchase Online -click this image- Resources, Downloads, Zips for Mult-Edit -click this image- Company NFO -click this image- Website Sitemap -click this image-

- Written and documented by David Deley



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