Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
From
25/10/2006 16:08:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/10/2006 12:50:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164539
Views:
8
>>
>>Creates and releases compile-time constants.
>>
>>You can use the #DEFINE and #UNDEF preprocessor directives to create compile-time constants in programs. By creating constants with #DEFINE instead of using variables, you can reduce memory consumption, increase performance, and simplify programs.
>
>Very good, Alexandre.
>But it is possible that "reduce memory consumption" means 'reduce the impact on MVCOUNT'.
>It could also be that "increase performance" refers to something totally different than the 'constant' being included in-line *IN* the instruction.

I've done a simple test. I've found a piece of ancient say/get code where a picture string '999.999' was mentioned six times. I compiled it, and found the string in the fxp six times.

Then I #defined it as a constant and replaced all six occurrences of the string with this constant. I compiled it, and found the string in the fxp six times, in pretty much the same places as in the first fxp.

So there's no pool - the constants still remain scattered throughout the code.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform