Hi Martin
this is faster:
tt=SECONDS()
WITH _SCREEN.ActiveForm
FOR I=1 TO 1000000
=.FontName
NEXT
ENDWITH
? '_SCREEN.ActiveForm III',SECONDS()-m.tt
But following code is much slowest one of '_SCREEN.ActiveForm'
( this because VFP is a single line interpreter, splitting a command
on more lines, with equal code, it is more and more slow
( VFP isn't a compiler or a intermediate P-code interpreter, it is a direct language interpreter)
tt=SECONDS()
FOR I=1 TO 1000000
WITH _SCREEN.ActiveForm
=.FontName
ENDWITH
NEXT
? '_SCREEN.ActiveForm III bis',SECONDS()-m.tt
My test is for ONE valutation, 100000 valutation is only for get a
measurable time with seconds().
I cannot use API CPU internal counter because VFP API call cycle is too long.
To notice that, _ VFP represents VFP COM engine interface, however the time turns out very along also in ' _ VFP.ActiveForm II '
Fabio