Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form object not exist but Screen Active Form does
Message
From
22/12/1999 15:06:29
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00302767
Message ID:
00307499
Views:
69
>>on the basis of which I feel safer leaving it to the OKL's.
>
>You shoudl NEVER feel sfaer with OKL's. They can interrupt running code and cause some very serious bugs that are very difficult to track down. What if you get teh OKL to work and the validation for textbox is running when the suer hits the OKL key? The focus will jump to the page without completing the valid code and possibly fire events associated with teh focus change before the currently running valid code finishes.

yes of course, thats the thing we dos programmers have got to get used to. Windows is so slow it needs multitasking just to stay only slightly behind the dos apps and thus its often the case that the code for one thing is still chuntering away while the user has moved on. I take the point.

>>Any thoughts about the out of scope formname?
>
>I'm not sure of what you mean by the scope of FormName.

this is a reference back to the original problem. I call the method in my Global App. That in turn refers back to the form from which I've called it but any reference to that form yields a bizarre 'object not found' error even when the debugger is plainly showing that the activeform is the relevant form and the form is visible and still has focus. It 'behaves' as though it has gone out of scope. You commented that if I could show you the code you might be able to offer an insight. That code was contained in my earlier missive...

>Forms are objects and that means theree are three different things about them that are commonly referred to as the name. There is the file anme of the SCX, their >Name property's value, and the name of a variable or property that holds an object reference to them.

I am calling this particular one by the form 'name' property which is recognised by the debugger as being the acitive form's name.
>
>The one that folks usually are talking about in relation to going out of scope is the object reference. The solution is to use a permanent object reference that has the same lifetime as the fomr itself. The best way to accomplish that is to use a form manager object to launch all of your forms and have that object keep an array of object references and identifying informatrion about every form that exists. Then you never try to address any form directly, you ask teh fomr manager to forward the message for you.

I've seen many references to this technique but I can't quite see how it works or how to set it up. Presumably its similar in principle to the global application object but it would be very helpful if you could point me to a working example.

Don't rush it however, as I now take this opportunity to wish all threadheads a merry Xmas and a fabulously successful new Millenium. I'm flying over to Seattle tomorrow and staying there, with my wife's parents, for the duration. I doubt if I'll get to see the Thread again till the 5th of January.

Best Wishes

Harry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform