Introduction to CMac: 04. 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:
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
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.'); }