Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution, name expression
Message
From
24/05/2001 21:35:02
 
 
To
24/05/2001 21:05:06
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00511274
Message ID:
00511286
Views:
15
Name expression --
Only works for expressions that evaluate to the name of something:
File names, tables, field names.
Significantly faster than macro substitution on those tasks.
Also properly interprets path names with embedded spaces that macro substution coughs on.

EVALUATE()
Works for expression which return a value.
Faster than macro substitution.
Recommended in most cases as a replacement for macro substitution for expressions.

Macro Substitution
Can interpret basically any VFP command, expression, or part of a command at runtime. At the heart of every command line interpreter embedded in a runtime.

In general, use only when above commands will not work for performance reasons.

Exceptions: looping structures. For example:
lcFilterExpression = " aField = 'my value'"
SCAN FOR &lcFilterExpression
    DO something
ENDSCAN

SCAN FOR EVALUATE (lcFilterExpression)
    DO something
ENDSCAN
In this scenario, the macro substitution is faster, because the substitution is performed once for the loop. The EVALUATE function is called for each record and so is significantly slower.

In addition -- for more complex runtime evaluation:
VFP 6 can compile PRGs at runtime.
VFP 7 can compile memo fields and strings at runtime.

Enjoy!

Jay
Previous
Reply
Map
View

Click here to load this message in the networking platform