General information
Category:
Coding, syntax & commands
Dennis:
> Visual FoxPro provides us with a three constructs for branching program
> execution – the standard IF…ELSE…ENDIF, the DO CASE and the IIF() . What
> is the benefit (in terms of performance) of one over the other? The most
> obvious statement to use, the DO CASE, is in every situation significantly
> slower, while the most unreadable and hardest to construct (the IIF()) was
> always the quickest to execute."
A couple of obeservations:
(1) IIF is a special case of IF..ELSE..ENDIF where the only instruction is an immediate assignment. It's _almost always_ possible to write a more efficient Asssembly routine for such specialized cases.
(2) DO CASE..ENDCASE is not the same as nested IF..ELSE..ENDIF statements because DO CASE..ENDCASE only counts once towards the nested level (nest IF..ELSE..ENDIF 65 times and it will fail, write 150 CASE and it will work). DO CASE..ENDCASE suffers a performance hit because it is not simply translated the same as nested IF..ELSE..ENDIF statements when compiled.
Daniel
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only