Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution
Message
From
28/12/2002 13:13:19
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00735756
Message ID:
00736314
Views:
22
Hi sergey,

>>Don't forget Macro substitution and EVAL() are cousins, they both require the runtime compiler to operate.
>
>I've to disagree with you on that one. Macro substitution require the runtime compiler because it can include any valid VFP code. EVALUATE() on other hand, can include only expressions so it can be processed by EVALUATE() function itself w/o the runtime compiler.

Though I agree that marco's are far more flexible than EVAL() eval itself does invoke the runtime compiler as the evaluated string can contain anything. For example:
cString = " ALLTRIM(STR(2)) = Test()"
? EVAL(cString)
? &cString

FUNCTION Test
RETURN "2"
As in this example is shown EVAL() and macros do not differ too much. The only diffence I can see is that the stringexpression has to return some value for the EVAL function. In both circumstances the string has to be compiled and executed. There is no way you can build a EVAL funtion without a runtime compiler.

Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform