Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
From
26/10/2006 12:56:00
 
 
To
25/10/2006 16:39:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164755
Views:
7
>This whole thing started because I said I thought #DEFINEs are more trouble than they are worth and people started giving good reasons for using them.
>I simply challenged those reasons. And at this point, for those still interested, I haven't heard counter-arguments that seem credible to me.

I think the strongest argument for #DEFINEs is where they replace otherwise mysterious values. The one I use most often is:

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

CRLF is easier both to type and to read. Similarly, constants are useful for "magic" numbers, like many automation parameters.

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform