>Command Time # of itterations > >Execscript 1.693 100 >_VFP.Setvar 0.000 100 > >Execscript 16.984 1000 >_VFP.Setvar 0.010 1000 >>As you can see VFP.Setvar is much faster. It's understandable, because Execscript() has to write code to the file, compile it and run from the file. _VFP.Setvar on other hand is built-in method of _VFP object. In addition _VFP.Setvar can work with local variables.
lnMaxItter = 1000 >lnCount = 0 >lnStart = SECONDS() >FOR i=1 TO lnMaxItter > EXECSCRIPT("lnCount = lnCount + 1") >ENDFOR >? "Execscript", SECONDS() - lnStart, lnCount > >lnCount = 0 >lnStart = SECONDS() >FOR i=1 TO lnMaxItter > _VFP.Setvar("lnCount", lnCount + 1) >ENDFOR >? "_VFP.Setvar", SECONDS() - lnStart, lnCount >