Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ExecScript vs macro
Message
From
15/02/2002 14:31:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
14/02/2002 16:41:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00620368
Message ID:
00620831
Views:
13
>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?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform