Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Static variable
Message
 
À
24/10/1999 11:16:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00276200
Message ID:
00280852
Vues:
15
Albert,

I was not discussing static members of a class but how to simulate static variables in code.

Unfortunately, whether you like it or not, when a feature is not available in a language you must find another way to do the same thing. In VB you must find a way to simulate inheritence, in VFP you must find a way to simulate static variables. Dismissing a work around that solves a problem caused by a limitation of the language because it is a work around skirts the question.

You cannot create a static member of a class nor a static variable in VFP. So, if the funcitonality of a static is required you must use some other method of accomplishing the task. For you example, I use a method of the main application object to create service objects. It knows if one is already in existance and acts accordingly. Would a static member be more ellegant, yes, can I use one now, no.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform