Clarion Advisor: Debugging Tricks

By Dave Harms

Posted June 28 1999

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).

Article comments

Post a comment

You must be logged on to post comments.

Clarion Roadmap

Try the roadmap (beta)

Search ClarionMag

 

Advanced search

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.