Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private Vars Declared in Init Scope
Message
De
16/12/2003 17:51:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
16/12/2003 12:27:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00859506
Message ID:
00859704
Vues:
20
This message has been marked as the solution to the initial question of the thread.
>Ok, how would that be done if using DO FORM and not CREATEOBJECT? To my knowledge, there is no method on the form where you can declare variables that will persist for the life of the form, right (without declaring them public)? Typically, I create form properties as a general rule, but I'm in the middle of converting a ton of FPD26 screens and the code already exists to create the vars that are used in the screen in the old FPD26 screens setup and I'd like to use the vars instead of form properties to speed up the process for now. Any ideas short of running a prg to declare the vars that then calls the form?

Why not just move the code that creates the variables into the calling prg? In your example, that would be between "Public xform" and createobject().

I know this is totally dirty and utterly non-OOP, but knowing your line is dead... er, you having a deadline...

>>
>>PUBLIC xform
>>xform=CREATEOBJECT("myform")
>>xform.show
>>DEFINE CLASS myform as Form
>>   xnumber=22
>>   PROCEDURE init
>>      priv xnumber2
>>      xnumber2=33
>>   ENDPROC
>>ENDDEFINE
>>
>>
>>xnumber is a property not a variable and valid in all life of form. and xnumber2 is only a variable. dead with end of init.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform