Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP - not seeing an opened form in Debugger 1

Status
Not open for further replies.

wetton

Technical User
Jun 26, 2006
42
0
0
AU
I cannot see an opened form in the debugger in my app possibly due to its depth in the parent object . Is it possible to create a file listing of objects at the time the file is called eg - when the form is opened.

I have tried the name method after do FORM xyz Name abc

The form is opened from a pageframe on my main form

so I have

Main form
Page3
Command button - click
Some code here, then
DO FORM xyz name abc

I see the main form in the debugger down to the control button but if I could search the object listing maybe I could find my newly opened form.

I want to use a prg to interrogate check boxes on the form to control further processing and I cant find the correct object name.

Any one help?

Thanks

PW

 
Hi wetton,

you may try adding abc to the watch window of the debugger, but DO FORM Name abc does not create a variable abc, as you may think. If you want an object for the debugger, either create a public object or at runtime point to the form with the mouse and call
Code:
o=Sys(1270)
Then o is a reference to the form. Actually you can do this with any object you want to inspect and not drill down from this or thisform.

Bye, Olaf.
 

Hi PW,

DO FORM xyz name abc

The problem with the above is that the variable name -- abc in your example -- will only be in scope during the Click of the button that launches it.

YOu could either do as Mike Gagnon suggested -- make abc a public variable. But only temporarily. Remove the PUBLIC declaration when you have finished debugging.

Or, set a breakpoint on the above DO FORM command, then single-step into the form's Init. You can then reference the form as THISFORM in the watch window.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks guys for good info.

THe nub of the matter was

I want to use a prg file to interrogate check boxes on the FORM to control further processing and I cant find the correct object name.

Any more help - or will one of the methods above help me?

PW



 
PW,

The recommended approach would be not to use a PRG file, but to write a custom method of the form. That way, you help make the form self-contained, and you can reference the checkbox with something like THISFORM.Check1.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

Once again Mike you have put me on the straight and narrow.

Many thanks


PW
 
Thanks to the other posters.

I was able to set a breakpoint and see the objects in the form but the .parent wasn't available so I was non the wiser.

And I was looking in both the Watch and Trace windows. The name did show on the Call Stack with the correct form name.

With Mike's suggestion I will never have this problem again.

Thanks
Guys.

PW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top