Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private all like vs. local
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00024047
Message ID:
00024139
Vues:
40
>Is there an advantage to using:
>LOCAL lcVariableName1, lcVariableName2, lcVariableName3
>vs.:
>PRIVATE ALL LIKE l*
>?
>
>I assume that compiler/run-time speed is an issue when private all like is used. However, private all like cuts coding time and variable management efforts considerably.
>
>How much speed loss with the private all like method are we talking about. And does it matter with today's fast computer systems?

LOCAL vars are only scoped to the immediate method, function or procedure that defined them. They go out of scope when "RETURN" is issued or the method ends (implied return). Because their scope is so limited, maintenance should not be an issue. I use them all the time, if private is required, you might consider making them properties of a class which can be globally accessed. That's the OOP way.

Steve Despres
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform