Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE - Why?
Message
 
 
À
31/03/2008 10:10:12
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01306848
Message ID:
01306940
Vues:
8
>>>Isn't that more of an issue of coding practices rather than using a variable vs defines? I can do the same thing you just said with variables.
>>>
>>Not exactly. If you define your constants in the include file, that's the only place where you would need to change them if used in multiple forms/programs.
>
>If I defined a variable in my main program as a constant (MY_CONSTANT = 10) then there is only one place I need to change it too. Just not getting the real difference here that actually makes a difference in development. I always thought they were something special, but they are just variables that dont change value. If I treat them as constants, then they are constants. What am I missing?

If you're using this MY_CONSTANT variable only in one program, then there is not much of a difference. If you want to have some common constants across the whole application, you may want to put them in the include file.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform