Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form object not exist but Screen Active Form does
Message
 
 
To
13/12/1999 15:10:49
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00302767
Message ID:
00302939
Views:
42
Hi Jim...

Here is the original post:

I have a global application object from which I call a method from whatever form is currently active. In one particular instance the the code falls over and tells me the relevant form does not exist. Yet the debugger shows '_screen.activeform.name' is indeed the form I'm trying to call and if I change the code (which I've done anyway) to call '_screen.activeform.mymethod' it works a treat.


Now, with respect to the reference of .Name, it is clear that this person had queried this in the debugger. Clearly, the individual was checking to see if _Screen.ActiveForm evaluated to an object. And, to further the check, queried the Name Property to see if ActiveForm pointed to the form in question. Since he was able to query a form object, it meant that _Screen.ActiveForm could be used. Now, based on the post above,the individual WAS NOT using the reference _SCREEN.ActiveForm. When he does, the code works great, to his his words. Therefore, alternatively to using _Screen.ActiveForm, some other method of referencing the form is being used. It is either a variable that never had scope, or a variable that had scope, but has since lost scope.One way to test tht is through the debugger.

I think my thought process is sound here, but please, if you see a flaw, bring it to my attention...

Once again, I know what you are attempting to do here, and all I can say is it will not work....


>Hi Jim,
>
>*IF* I were just throwing darts to see what happens, then I got an interesting offshoot indeed!
>
>I believe that John's answer is incorrect because I believe that the .Name is not the way to "address" a form instantiated by "Do Form" or CreateObject but rather the object reference variable is to be used. Thus it would not at all be a question of "scope" for the variable in question (.Name isn't even a variable so it cannot really go out of scope while the form still lives), but rather that the *wrong* variable is being used.
>
>Jim, your quickness to consistently jump to the defense of Mr. Petersen is puzzling to say the least. Your responses *had* always tended to be thorough, complete, accurate and impartial but lately...
>
>Jim N
>
> >>John,
>>>
>>>I believe that you have provided a technically incorrect response.
>>>
>>>I trust that you will correct it.
>>>
>>>Just calling them as *I* see em.
>>>
>>>Jim N
>>
>>Jim,
>>
>>In what way is John's suggestion techincally incorrect? It appears to me also that the reference being used in teh global application object is out of scope and no longer points to the form. How is John's answer incorrect? What is your revision of his answer to correct it? Or are you just throwing darts to see what happens?
Previous
Reply
Map
View

Click here to load this message in the networking platform