tips
[Top] [All Lists]

REALbasic Tip: Conditional break points in the debugger (revisited)

To: REALbasic-tips at lists dot realsoftware dot com
Subject: REALbasic Tip: Conditional break points in the debugger (revisited)
From: Geoff Perlman <geoff at realsoftware dot com>
Date: Tue, 3 Aug 2004 10:17:07 -0500
Cc:
Delivered-to: REALbasic-tips at lists dot realsoftware dot com
In November of 2001 I sent out a tip about using conditional breakpoints in the debugger. With the addition of the BREAK command in REALbasic 5.5, it becomes even easier.

Conditional break points can be handy when you want to step through your code in the debugger but only after a specific condition is met. The debugger doesn't currently support conditional break points but you can get the same effect. Say you want to break in a particular method when the variable x equals 10. At the point in your code where you want to break, add the following If then condition:

If x = 10 then BREAK

REALbasic 5.5 also added single-line IF statements which makes simple IF statements even better.

If you have REALbasic 5.0 or earlier, you can get the same effect by simply creating an IF statement and putting a break point in the middle of it.

If x = 10 then

End if


Notice the empty line in between If and End If. Place the cursor on the empty line then choose Set Breakpoint from the Debug menu.


In either case, when you run your code, REALbasic display the debugger if the condition is met.
--
Geoff Perlman
President and CEO
REAL Software, Inc.

<Prev in Thread] Current Thread [Next in Thread>
  • REALbasic Tip: Conditional break points in the debugger (revisited), Geoff Perlman <=