foxmulder,
To start with the most important acknowledgement: You're right, macro substitution is not much of a performance hit in this case, where this is done once to change an image control property.
I don't know from what context you come with your statements 1) and 2) about evaluate(). They both don't matter at all here, as the evaluate() is not evaluating sql at all her.
1) is also a very vacuous statement, as rushmore optimisation only is applied to SQL where and join clauses and for clauses of several commands anyway, so that statement can also be made about really any function or command, not only about EVALUATE(). Then you can also argue only anything related to SQL and tables is the usable, because only those parts of the language can be rushmore optimised.
And in regard to statement 2) that's not only true for EVALUATE(), also macro substitution and also any function call can lead to wrong results, if you do have an error in there, that's quite some nonsense to only apply that reasoning to EVALUTE().
There are two things, why it's better to avoid macro substitution wherever possible:
1. Any line containing any macrosubstitution is accepted by COMPILE or BUILD, even if it can't turn into a valid code line in no way, eg you can compile "Fdjkfhd&R", while no value of R can turn this into valid code at runtime. This is making macro substitution the most risky thing to do of all, as errors of it's usage will only show up at runtime, you don't detect many typos. Of course you will run and test your code, so such errors will show up early.
2. In perspective of migrating to other languages you better prefer generally available options instead of vfp specifics like macro substitution. There is of course a point where this is stupid, eg if it limits you in using the best option and forces you into unelegant code, which in turn runs slow and forces you to migrate. That would be self fullfilling prophecy of the worst kind.
That said, yes, macro substitution is especially nice within SQL to generate queries danymically. And the reulsting query can look much more elegant and in the end also run faster than a static query. Also that is one of VFPs advantages: In other languages SQL queries only exist as strings you send to your database, while in VFP it compiles as native part of the language.
And actually I never had a reson to use EVAL() in SQL, but macro substitution is useful there. The reasoning for that is that SQL only needs to be compiled once and actually compares to a loop through the records, if not even nested loops, so here it really pays to have one compilation for an overall best optimised query.
Bye, Olaf.