Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More Form q's
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00303139
Message ID:
00303782
Views:
16
>>>>You certainly can call a method from one form in another form wihtout a formset, you simply need a reference to the form that contains the method.
>Right; but my problem is that one form doesn't neccissarily call the other. They may both 'exist' independately of each other; but if they do exist at teh same time; I need updating to be done on each others forms.
>One may be called by a menu item; and the other by pushing a button of a 3rd unreated screen. So "calling" form isn't relevant; I'd have to go all the way back to teh calling application to create an array to hold possible calling refrences for different forms I'd need -- and hence; a global variable.


Josh,

You don't need a global variable, you need a central form manager that launches all forms regardless of where the request comes from. The form manager might have a method named DoForm that is passed parameters to tell it what form to run. It then runs the form and makes a record of the form in an array property. You can use a form class for all forms that records the reference to the form manager and has a method named IncomingMessage. The form manager can have a method named BroadcastMessage. The form that wants to communicate with another form can issue a Thisform.oFormManager.BroadcastMessage("Whatever the message is"). The manager's BroadcastMessage method works its way through the array of open forms and calls each one's IncomingMessage Method and passes the message in. Each form would receive the incoming mesage and decide it if needs to do anything or not.

You see no global variable names anywhere. The form manager passes THIS as a parameter to the forms, and the forms all record the THIS reference in a property named oFormManager.

The issue here is that there are problems when you try to invoke object communications and your system is not aware of what objects exist and where they are. When your code depends on the name of something you have a major limitation on flexibility and extensibility.
Previous
Reply
Map
View

Click here to load this message in the networking platform