Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code Efficiency Question
Message
De
15/03/2001 09:06:30
 
 
À
14/03/2001 19:40:31
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00485113
Message ID:
00485305
Vues:
9
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform