Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Efficiency Question
Message
From
15/03/2001 09:06:30
 
 
To
14/03/2001 19:40:31
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00485113
Message ID:
00485305
Views:
8
Spencer:

Use an immediate IIF when you want to make an assignment depending on a condition. An immediate IIF should not be used when you want to run a method if and only if an expression is True.


For example:
myVar = IIF(SomeCondition, SomeValue, SomeOtherValue)
performs faster than
IF SomeCondition THEN
   myVar = SomeValue
ELSE
   myVar = SomeOtherValue
ENDIF
but
=IIF(SomeCondition, DoSomething, .F.)
is just plain silly and it is better to use
IF SomeCondition THEN
   DoSomething
ENDIF
instead.

Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform