Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
From
24/10/2006 21:16:56
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
24/10/2006 20:05:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164242
Views:
13
Don, if the constant is used in only one place, there is no real advantage to using a constant if its value is something obvious like "my constant". But you'll understand why it might be better to use DAYS_UNTIL_EXPIRY in code rather than GOMONTH(subsview.dsub_start,12*subsview.isub_duration)-DATE().

Also, the app may be subject to a standardized practice that sees all constant values #DEFINEd at the top of each proc, in which case you'd need to respect that standard.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform