>Hi,
>
>anyone have any performance metrics on 'execscript' vs '&' (macro sub) for code that can use either?
Sergey's results confirm what I think is the mechanism of how ExecScript works - it creates a temporary .prg file (or treats the parameter as contents of one), compiles it and runs it. Now if you do that in a loop, a macro won't be recompiled each time (because the variable didn't change), while ExecScript doesn't have this sort of caching and is, thus, far slower - in a loop.
The real use for ExecScript is to run snippets stored in memos, or assembled on the fly. Depending on use, it may be better to simply write these memos out into .prg files and compile them when needed, but if they change too often, ExecScript may be better.
Obviously, using ExecScript for one-liners is an overkill.
BTW, who was the guy who said "if you haven't seen it in three consecutive versions of Fox, you figure yourself"? The compile-on-the-fly feature came up in SP3 for VFP6, and it was a feature which was missing (and on the wishlist) for years. I'm not complaining, of course - but if this feature was implemented when we practically gave up hope, what other things can we have, which we always wanted?