Startseite > lang > iif 
 en fr es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW eo
Zurück  Weiter  Bearbeiten  Umbenennen  Rückgängig  Suchen  Verwaltung  
Dokumentation  
Achtung! Diese Seite wurde noch nicht übersetzt.  Siehe englische Version 
IIf
Value = IIf ( Test AS Boolean , TrueExpression , FalseExpression )
Value = If ( Test AS Boolean , TrueExpression , FalseExpression )

Evaluate the Test expression, and return TrueExpression if this expression is TRUE, or FalseExpression if this expression is FALSE.

BE CAREFUL!

Contrary to IF, or the C/Perl ? operator, both TrueExpression and FalseExpression are evaluated, whatever the value of Test is.

Beispiel

X = 7
PRINT If((X MOD 2) = 0, "even", "odd")

odd

' Never do the following in real code, because it is not translatable!
X = 7
PRINT "You have " & X & " message" & If(X <> 1, "s", "") & " waiting."

You have 7 messages waiting.

PRINT If((X MOD 2) = 1, "odd", 1 / 0)

Division by zero

Siehe auch

Test Control Structures & Functions