Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MESSAGEBOX
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00365597
Message ID:
00366070
Vues:
15
>#DEFINE MSG_FEE_NOT_0 "The Fee can't be $ 0.00 or a negative number."

>The constant name is pretty obvious and I use it in a bunch of different places to validate user input. If I ever want to change the actual message string I change it in 1 place, I don't have to go searching through the code.

This applies even more so to numeric values, it is much easier to replace occurences of MY_DEFINED_CONSTANT than replacing occurences of 1 - 1 could mean anything at any point in the code & you need to understand the use of the value at that point, whereas MY_DEFINED_CONSTANT is likely to be more specific.
Mike

"I can live with doubt and uncertainty and not knowing. I think it is much more interesting to live not knowing than to have answers that might be wrong." - Richard Feynman
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform