Clarion Advisor: Debugging Tricks
Posted June 28 1999
Clarion Magazine has featured several articles on debugging applications (go to the Search page and search for "debug"). But you can never have too many tricks up your sleeve, and Clarion developers get as wily as anyone when it comes to using alternative debugging techniques.
Many developers use STOP() and MESSAGE() for quickie debugging, but as Russ Eggen recently pointed out in his excellent article on the debugger, these statements interfere with the normal operation of your program, and the behaviour with the use of these statements may be quite different from the behaviour without these statements.
One non-intrusive technique is to put messages in the window's title bar. Just use the following line of code any time after the window has opened:
0{PROP:Text} = 'Some debugging text'
The zero stands for the current window and is more convenient
than having to know the actual window label (which may be
Window, QuickWindow, or something else).
Another bonus is that you can use this statement anywhere a window
is open - the label of the window doesn't have to be in
scope. So if the procedure with the window calls a source code
function, you can still use 0{prop:text} inside the function.
If you're testing for a particular condition in your code which happens more than once, but you're always using the same message, you'll probably want to know that you're looking at a redisplay of the message and not just the original message. Add a timestamp to the message:
0{PROP:Text} = CLOCK() & ' Some debugging
text'
Now you'll be able to see when the message changes.
Article comments
Post a comment
You must be logged on to post comments.
Talk To Us!
Search ClarionMag
From the archives
Running Clarion on a Mac
2/11/2010 12:00:00 AM
More and more Clarion developers are trying out the Mac. Perhaps, like Mark Riffey, you want to do a little iPhone development. But can you run Clarion in a Windows virtual machine on a Mac? Mark shows how it's done.
