Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing modeless forms.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00292565
Message ID:
00292833
Vues:
24
>This won't work if myForm is modeless. Let's say the code: DO FORM myForm NAME oMyForm is in the click event of a command button. The variable oMyForm is scoped to the click event. Because the form is modeless, the click event finishes and the variable is no longer accessible. Here is an example:
>create 2 modeless forms, form1 has a command button with the following code: DO FORM form2 NAME oForm2 LINKED. When you run form1 and click on the button, form2 will come up and immediately close, because the variable oForm2 goes out of scope almost immediately. If form2 is made modal, then the code stops executing in the click event leaving the variable in scope, and therefore accessible.

Of course, modals are fine for certain situations. But for modeless, just don't use LINKED and it should work fine. I've found LINKED of little actual value. But if you need it, then a way to conquer your problem is to create a form property (or an array if many forms):

1) Add Parent form property, say oMyForm.
2) Launch child form like this:

DO FORM myForm NAME thisform.oMyForm LINKED
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform