Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Possible VFP7/8 ER: Integrate Crystal Reports
Message
From
17/04/2001 21:16:30
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
To
17/04/2001 17:30:53
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00495582
Message ID:
00496493
Views:
14
>>I think we're confusing "pre-processing" and "compiling"; these are simply "code substitutions" performed during the pre-processor stage. The substituted code (ie. .... SYS( n ) ....) is what is getting compiled.
>
>Here's another good example for this:
>
>#DEFINE ccMESSAGE0 "Hello Mike!"
>#DEFINE ccMESSAGE1 Hello Mike!
>#DEFINE ccMESSAGE2 UPPER('Hello Mike!')
>#DEFINE ccMESSAGE3 ('Hello Mike!')
>?ccMESSAGE0
>?[ccMESSAGE1]
>?ccMESSAGE2
>?UPPER ccMESSAGE3


Yes, and for what it's worth, it's frequently more "efficient" to use a "variable" instead of a "constant"; eg.

m.cGreeting = "Hello Mike !"

#DEFINE C_GREETING "Hello Mike !"

If, for example, a program referenced "Hello Mike !" 10 times, using m.cGreeting is more "efficient" than referencing C_GREETING because using C_GREETING will add "10" occurances of the literal "Hello Mike !" to the "literal pool" vs "one" using the variable; ie. the code for the "variable case" is more compact.

"Literal pool" optimization is usally found in many native compilers, but not in VFP.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform