Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form object not exist but Screen Active Form does
Message
 
To
06/01/2000 11:49:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00302767
Message ID:
00314164
Views:
57
Harry,

You are confusing the value of teh boject's name proeprty with the name of the reference to the object.

If you do not specify what name should reference the object then it is a name assigned by VFP whihc may or may not be the same as the name property's value.

If you need to reference an object from outside of its own scope (in its own methods or the methods of its contents) you need to insure that you have a valid reference to the object available. With a form you can do this by;

DO FORM Whatever NAME VarReference

Then VarReference will refer to the form as long as VarReference is in scope.

A much more flexible approach is not to let any code DO a form, but rather have a formmanager object with a method for running forms. When code want a form it calls the form manager and asks it to run a form. The form manager can keep track of the forms it has run and even assign them names by using an array property. When a fomr needs to call to another form it calls teh fomr manager and passes the message to be sent that name of the form to send it to and the form manager figures out how to address that form.

Without a form manager to help the only vechicle available to address forms consistently without knowing thw reference to them is to use the _screen.Forms() collection. You might have to walk through all the forms until you find the one with name property you want.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform