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
Search ClarionMag
From the archives
A Callback Technique for Capesoft's FileManager2
12/21/2006 12:00:00 AM
CapeSoft's FileManager2, and its more recent incarnation FileManager3, are amazing products: they completely automate the process of upgrading client databases, whether local or across a network, and make it easy to do file maintenance. Randy Rogers shows how to add a callback procedure to FM2 to provide user feedback during startup.
