Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public variables VS objects
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Public variables VS objects
Divers
Thread ID:
00795846
Message ID:
00795846
Vues:
48
Hi!

I have an old application where I define a lot of public variables in the main program. So I can use it in all program. I'm explain better using just seven parameters, but, in pratice, I have hundreds of them...
Public LicenciadoNome, LicenciadoCNPJ, EmpresaNome, EmpresaCNPJ, Programa, Versao, DataExpiracao
m.LicenciadoNome = "Qualquer Um"
m.LIcenciadoCNPJ = "Qualquer Outro"
m.EmpresaNome = "Rodolfo"
m.EmrpesaCNPJ = "111.11.11.1.1"
m.Programa = "Super Programa"
m.Versao = "1.0"
m.DataExpiracao = {}
Now I'm updating my framework and I'd like to work just with objects... So, I think something like that:
Public oObj
oObj = CreateObject("Empty")
AddProperty(oObj,"Licenciado",CreateObject("Empty"))
   AddProperty(oObj.Licenciado,"Nome","Qualquer Um")
   AddProperty(oObj.Licenciado,"CNPJ","Qualquer Outro")
AddProperty(oObj,"Empresa",CreateObject("Empty"))
   AddProperty(oObj.Empresa,"Nome","Rodolfo")
   AddProperty(oObj.Empresa,"CNPJ","111.11.11.1.1")
AddProperty(oObj,"Programa",CreateObject("Empty"))
   AddProperty(oObj.Programa,"Nome","Super Programa")
   AddProperty(oObj.Programa,"Versao","1.0")
   AddProperty(oObj.Programa,"DataExiracao",{})
The code above is typed in the main program and creates an object that includes all variables in just one (and organized) object...

Some idea and comments about this solution? .. .Suggestions?

TIA
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform