Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE - Why?
Message
De
31/03/2008 16:37:16
 
 
À
31/03/2008 10:01:48
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:
01307141
Vues:
12
>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.

Besides, do like type CHR(13)+CHR(10) all over the place, or would it be easier to type CRLF.

#DEFINE CRLF CHR(13)+CHR(10)

>
>>Then look at this from a maintenance viewpoint. Values that appear in code are called, "magic numbers". They do something, but you don't necessarily know what they mean. It's just a number. And, it may appear in several places, which means if the value changes at some point, you have to hunt them all down. If you use a #DEFINE, you can give the number some meaningful name. And, if all the #DEFINEs are in a single file, you only have to go one place to change them.
>>
>>Run down to your local Borders bookstore and find the book "Code Complete" by Steve McConnell and read about magic numbers.
>>
>>
>>>Is this an issue really?
Greg Reichert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform