Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE problem
Message
De
13/02/2007 13:36:24
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01194874
Message ID:
01195281
Vues:
17
>>>>>Why (just curious)?
>>>>
>>>>You have just one global object and access its properties rather than creating public variables for most used things.
>>>
>>>So anywhere you use it you use _application.MAXRXS rather than MAXRXS.
>>>
>>>It may be more OOP but it doesn't seem to make much difference (except a longer variable reference) to me..?
>>
>>What would you do if you need several global variables? Create each of them as a public var?
>
>Generally that is what I do. I preface the names with g so I know they are global.
>
>Rather than ..
>
>_application.addproperty("MAXRXS") (one command per property)
>
>I use
>
>public giMAXRXS (and can declare several variables in one command)
>
>public variables have global scope. _application properties have application scope.
>
>I'm lazy - I like less typing. The OOP way is elegant but not necessarily better IMO.

Did you read my message#1194892? In my class I use this_access to "automate" the addproperty process, it's really slick. Once the object is global, so are all the properties you add by simply assigning them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform