Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forms Recognize each other in Develpment but not Product
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Divers
Thread ID:
01092026
Message ID:
01092090
Vues:
20
Hi Julie,

> In development environment I can refer to screen2.whatever but in production I get screen2 not an object. What am I missing?

When you run an SCX form from the Command Window, VFP creates a public variable that holds a reference to a form. However, if you run a form from a program file, VFP creates a private variable. If this happens to be in a procedure, the form reference is gone away after the procedure ends.

You can achieve the same effect as in the Command window using code like this:
PUBLIC screen2
DO FORM screen2.SCX NAME screen2
This puts the reference to the form in a public variable named screen2. However, in the long run you might want to study one of the available frameworks. They usually solve the problem of dealing with form references and inter-form communication using some sort of a FormManager class. Those classes also take care of cleaning the references properly, handling the situation of the form already running, or preventing multiple instances of one form.
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform