Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referencing modeless forms.
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00292565
Message ID:
00293278
Views:
23
>>DO FORM myForm NAME thisform.oMyForm LINKED
>
>Thanks Bruce,
>
>I agree with you about LINKED. I just used the linked example to illustrate that the variable oMyForm goes out of scope. The same is true without using linked. The form wouldn't close right away, but you would NOT be able to reference it with oMyForm. I think it's easiest to just make the variables public, but an array might be interesting. Thanks again for your help.

Yes, the ultimate way to have all forms capable of communicating with each other is to use app object or top-level (as I do) properties to assign in the NAME clause when launching any forms, as I pointed out above.

If many forms use an array, e.g.,

Topform.nChildren = Topform.nChildren + 1
DO FORM myForm NAME Topform.oChildren(Topform.nChildren)

if not many, individual properties make form name-identification easier:

DO FORM myForm NAME Topform.oChild1

It's basically a little like using PUBLICS, but more contemporary and OOPish. I have literally stamped out all PUBLICS in my apps now :)

Note that Topform itself is global, since launched in the main PRG with a NAME clause:

DO FORM TopForm NAME Topform
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform