lnStartIF = SECONDS()
FOR i = 1 TO 1000
IF SomeCondition
SomeObject.Refresh()
ENDIF
ENDFOR
lnEndIF = SECONDS()
lnStartIIF = SECONDS()
FOR i = 1 TO 1000
IIF(SomeCondition, SomeObject.Refresh(), .F.)
ENDFOR
lnEndIIF
MESSAGEBOX(;
[The IF statement took ] + ALLT(STR(lnEndIF - lnStartIF)) + ;
CHR(13) + ;
>Anyone have a considered response to the following?
>
>Given that in FoxPro an immediate IF, IIF(), is more efficient than an equivalent IF...ELSE, I had a question.
>
>Would this strategy, in fact, actually be more efficient in conditionally calling a form method. For example, would
>
> =iif( SomeCondition, SomeObject.Refresh(), .F. )
>
>have some efficiency advantage (however trivial) over
>
> if ( SomeCondition )
> SomeObject.Refresh
> endif
>
>I fully appreciate that likely of greater concern are issues of code readability, maintainability, etc. than negligible speed improvements.
>My question is really just for a point of knowledge. Thanks.