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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very strange form object reference

Status
Not open for further replies.

dickylam

IS-IT--Management
Jun 24, 2001
86
I am facing very strange in VFP 6.0

I have a form with a name reference with it, like

do form newform name newref

before this form done, a small program is running and set newref to be public, like

public newref

however, when I try to use such reference to control the object, I will face

"newref is not an object"

this message is not come when I have around 10 forms, is this related with memory problem or MSVFP bugs ?

Please advise
 
dickylam

If you open the debugger the point of the error, can you see the "newref" as a form object? Is it possible that one gets cleared somewhere? Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Are you saying the Public variable is created BEFORE you do the Form? Is the Form non-modal, so somewhere else in the application you start the "small program"? Are you just doing this in the development environment - not in a runtime application?

Rick
 
I solved myself, this is probably my mistake, it is because, a small program I have to define all variables before loading the form, however, one of the problem form init method has one command of "object.setfocus" and therefore the form's activate method is triggered, as a result, an error occured. The form object reference is "logical", if I ignore such error, the program continue to load other form, once back to the first problem form, the form's reference become object again. Therefore, at last, I remove the setfocus method placed in init method, then it works fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top