Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy way to breakpoints in forms
Message
From
17/07/1998 02:26:37
 
 
To
16/07/1998 22:29:09
Chris Crachiolo
Blackmoor Associates Incorporated
New York City, New York, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00117749
Message ID:
00118465
Views:
19
>I was having the same problem when I discovered this message thread. Nothing worked in trying to trace through the code of a method I had added to a form, not even using ASSERTS as you suggested. (I was running the form from the command window, or the project manager. The method is invoked by the click event methods of two different command buttons, with different respective parameter values). What finally worked was setting a breakpoint on TIME(), which, of course, changes constantly. The only problem now is VFP crashing while I'm stepping through the method code ("this program has performed an illegal operation and will be shut down..."). I seem to incur crashes quite frequently when using the debugger. Am I asking for trouble by invoking a method from another method? The method seems to crash when it hits a REPORT FORM command. Any insights would be more than appreciated. Now let me go see if I have any walls left to beat my head against...
>
>>>How do you set a breakpoint in a form (without inserting code)? I can add a breakpoint to a prg through the debugger, but how do you do the same for a form?
>>>
>>>The only way I've found to do it is to have a form method (called mySuspend which has the 2 lines of code "DEBUG, SUSPEND") and then set an ON KEY LABEL CTRL+Z _screen.ActiveForm.mySuspend. When I hit ^Z, this pauses my form, and the form context is loaded into the debugger. I can then set breakpoints and resume.
>>>
>>>Bob
>>
>>If you want to run compiled code with the debugger, then add an ASSERT .f. line at the point where you want the break. You may have to also put in SET ASSERTS ON if you have SET ASSERTS OFF in your Main PRG.
>>
>>Then run your EXE from the command box. The usual ASSERT box will pop up and you can open the debugger.
>>
>>Running the same EXE from the desktop (no VFP) does NOT fire the ASSERT line. It is ignored.
>>
>>HTH
>>Barbara

One of the things you might try to cut down on the crashes in the debugger is to clear all existing breakpoints before you set any new ones. (the icon of the hand with the 'X' on it). VFP seems to keep old breakpoint on code even if you have long since overwritten those particular lines with new code. I've seen it get so bad that you could not even step thru a single line of code such as:

X = 1

Clearing the breakpoints seems to clear it up.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform