Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom classes instead of global variables
Message
 
 
À
17/01/2000 13:14:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00319087
Message ID:
00319093
Vues:
14
>>I'm trying to make a class to hold variables that I need to be public. I'm a bit confused, though, on how to do it. Here's my main program:
>>
>>
>>PROCEDURE main
>>
>>PUBLIC goSettings
>>
>>DEFINE CLASS settings AS CUSTOM
>>   CurClient = ""
>>   CurProject = ""
>>   CurUser = ""
>>ENDDEFINE
>>
>>goSettings = CREATEOBJECT('settings')
>>
>>ENDPROC
>>
>>
>
>Don't put your DEFINE code inside the procedure. The class definition only has to be findable by VFP when the CREATEOBJECT code runs. This means in the same prg, or in another prg that can be found through SET PROCEDURE.

Ok, that did it.

Thanks,

Michelle
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform