>>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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement