Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need opinion/advice about instantiating forms
Message
De
21/11/2005 08:58:18
 
 
À
19/11/2005 16:25:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01070570
Message ID:
01070722
Vues:
12
>>I'm having trouble understanding when it would be better to instantiate a form using the NEWOBJECT function (assuming the form has been subclassed) rather than DO FORM, or visa versa.
>>
>>If I create a data entry form that's been saved to a .scx file, and the same form has also been subclassed, what are the benefits/downsides of calling the form using DO DataEntry.scx rather than
>>loForm = NEWOBJECT( "DateEntry", "C:\Developement\Myforms.scx" )
>>loForm.Visibile = .t.
>>
>>In what scenarios would I choose one method of the other.
>>
>>Thanks ahead of time for the advice.
>
>if you will need to access that form from other code then definitely you should go with NewObject() way
>The obly thing to remember is to assign reference to public variable or application property that persist all time.

A reference can also be accomplished with DO FORM
DO FORM whatever NAME goWhatever
Personally, I create a private variable, that nevertheless starts with go, in the main program. The g stands for global. I also initiate it there to NULL. In the whole application I can use this variable, for example in the SKIPFOR of the menu. E.g. SKIP FOR..
NOT ISNULL( m.goWhatever )
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform