|
- 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 4: Make_Message
MAKE_MESSAGE() is useful when you are debugging macros. The output goes
to the message line at the very bottom left of the Multi-Edit screen.
Try the following macros:
| Code: |
macro_file mycmac;
void testint()
{
int i = 12;
make_message('i=' + str(i));
}
void testhex()
{
int j = 0x5A7A;
make_message('j=0x' + hex_str(j));
}
void testreal()
{
real pi=3.14159265358;
make_message('pi=' + Rstr(pi,7,4));
}
void teststr()
{
str hi='Hello World';
make_message('hi="' + hi + '"');
}
void testall()
{
int i = 12;
int j = 0x5A7A;
real pi=3.14159265358;
str hi='Hello World';
make_message('i=' + str(i) +
' j=0x' + hex_str(j) +
' pi=' + Rstr(pi,7,4) +
' hi="' + hi + '"' );
}
|
Sometimes you need to pause execution of the macro so you have time
to read the message. This can be done by adding a call to READ_KEY
after the MAKE_MESSAGE
| Code: |
macro_file mycmac;
void testpause()
{
int i = 12;
int j = 0x5A7A;
real pi=3.14159265358;
str hi='Hello World';
make_message('i=' + str(i) +
' j=0x' + hex_str(j) +
' pi=' + Rstr(pi,7,4) +
' hi="' + hi + '" Press any key...' );
read_key; //Pause, wait for user to press a key
make_message('Thank you.');
}
|
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12.1:
12.2:
12.3:
12.4:
|