Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution
Message
From
27/12/2002 13:45:09
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00735756
Message ID:
00736143
Views:
27
Sergey,

>My point is, that there is no reason to use macro substitution if code can be written w/o it.

As others have mentoined, performance can be one of them. For example:
cEval = "Somefield = SomeValue"

SCAN FOR EVAL(cEVal)
	.... Do your stuff here ...
ENDSCAN
Is never rushmore optimizable en far slower than
SCAN FOR &cEval
	.... Do your stuff here ...
ENDSCAN
Of course the same applies to all situations where the EVAL is evaluated more than once while a single evaluated macrosubsitition does the same.

Don't forget Macro substitution and EVAL() are cousins, they both require the runtime compiler to operate.

I certainly agree that macro's can be (and are beeing) miss-used by lower skilled programmers, but IMO its not that easy to define a general rule about when to use or not to use macro's.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform