Name
If...Then...Else Statement
Synopsis
Standard syntax: Ifcondition
Then [statements
] [ElseIfcondition-n
Then [elseifstatements
] ... [Else [elsestatements
]] End If One-line syntax: Ifcondition
Then [statements
] [Elseelsestatements
]
condition
required; BooleanAn expression returning either
True
orFalse
or an object typestatements
optionalProgram code to be executed if
condition
is truecondition
-n
optionalSame as condition
elseifstatements
optionalProgram code to be executed if the corresponding
condition-n
isTrue
elsestatements
optionalProgram code to be executed if the corresponding
condition
orcondition-n
isFalse
Description
Executes a statement or block of statements based on the Boolean
(True
or False
) value of an
expression.
Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.