Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scope of Properties
Message
De
09/12/2001 09:55:02
Carmen Gassi
Perseus Software Systems
Oakville, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00591662
Message ID:
00591822
Vues:
25
Hi Jim
Thanks, understood, and form now working properly with added property available to all methods in the form.

Regards
Carmen
>Carmen,
>
>If you look in the init of your form you will see the parameter statement. If it is LPARAMETERS then the parms received will be local if it is PARAMETERS the arguments passed in will be private.
>
>The proper solution ot your problem is to use a form property. Fomr properties are tied to the form object and are accessible to anything that can access the form object, for example;
>
>
>* Form Init
>LPARAMETERS tcMyValue
>IF EMPTY(tcMyValue)
>  tcMyValue = ""
>ENDIF
>Thisform.MyProperty = tcMyValue
>
>
>From here on anything can access that value by using, ThisForm.MyProperty.
>
>The reason you saw it as logical when you added it to the form is because it is initially create as a logical property with a value of .F.
>
>The reason you can't see the variable outside of the Init or load is because these are events that run and finish, and their variables go out of scope whne th event finishes. The solution of scope for variables is NEVER to use a PUBLIC. It is to fix the app so a PUBLIC is not required. In OOP that is invariably to use a property of some object to hold the data.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform