Clarion Advisor: Debugging Tricks

by Dave Harms

Published 1999-06-28    Printer-friendly version

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.

 


David Harms is an independent software developer and the editor and publisher of Clarion Magazine. He is also co-author with Ross Santos of Developing Clarion for Windows Applications, published by SAMS (1995), and has written or co-written several Java books. David is a member of the American Society of Journalists and Authors (ASJA).

Printer-friendly version

Reader Comments

To add a comment to this article you must log in.

 
 

Search

 

Advanced Search
Topical Index

Related Articles

Subscribe to
ClarionMag

One year: $184

(includes all back issues since '99)

Renewals from $134

Two years: $274

Renewals from $224

More Info

Subscribe Now!

ClarionMag Blog

RSS Feeds

Updates via Email

Enter your Email


Powered by FeedBlitz

Quick Links