tips
[Top] [All Lists]

Better Debugging

To: "REALbasic Tips" <realbasic-tips at lists dot realsoftware dot com>
Subject: Better Debugging
From: Geoff Perlman <geoff at realsoftware dot com>
Date: Wed, 15 Mar 2000 11:17:30 -0600
Sometimes when you are debugging, you need to view a lot of data as your
code executes. Since the Variables window in the REALbasic Debugger only
shows the current state of objects and variables, it may not be sufficient
if you need to examine how these items are changing while your code
executes.

A simple solution is to add a DebugResults window to your project. Simply create a new window, name it "DebugResults" and add a multi-line editfield
to it. As your code executes, you can append any information you want to
this window and see the all the results as they happen. Once you have
created a DebugResults window, add an Append method to the window that
accepts a string as its parameter:

Sub Append(results as String)
  editfield1.text = editfield1.text + results
End Sub

Now anytime you need to see results from your code as it executes, simply
call the Append method of the DebugResults window:

DebugResults.append "put the results here"

If the DebugResults window is not open, calling its append method will open it. If it is open, calling the append method will simply append the results
you pass to the existing instance of the window.
--

Geoff Perlman
REAL Software, Inc.
http://www.realsoftware.com
mailto:geoff at realsoftware dot com



 - - - - - - - - - -
Got a useful tip to share? Send it to us at:
REALbasic-tips at lists dot realsoftware dot com dot
For list commands, send "Help" in the body of a message to
<requests at lists dot realsoftware dot com>



<Prev in Thread] Current Thread [Next in Thread>
  • Better Debugging, Geoff Perlman <=