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