Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution
Message
From
17/12/1999 17:22:15
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00305094
Message ID:
00305503
Views:
25
>>>I don't disagree - but the line of code I posted is legal, and accomplishes the task without the need for the intervening memvar. I rarely advocate macro expansions, but Mike's syntactic argument was not correct. I did state up front that, IMO, EVAL() is a better solution.
>>
>>Can you think of a place where macro expansion would be better than EVAL ?
>
>Sure - expanding the target of an operation or a full clause of a command where name substitution is inappropriate are obvious ones. Situations where the macro expansion occurs once rather than per record EVAL() is another, for example:
>
>cExprToTest = 'Color = "RED"'
>
>SELECT * FROM MyTable WHERE &cExprToTest
>
>will outperform
>
>SELECT * FROM MyTable WHERE EVAL(cExprToTest)
>
>since the macro expansion is executed once, and the expanded statement then becomes Rushmore optimzable (assuming appropriate tags), where the EVAL() must execute against each record of the table.

It's a good thing to know this. Thanks Ed!
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform