Syntax
| If condexpr Then [instruction] [Else instruction]
-or-
If condexpr Then
statements
[ElseIf condexpr Then
statements]...
[Else
statements]
End If
-or-
If TypeOf objexpr Is objtype Then ...
|
---|---|
Description
| Form 1: Single line if statement. Execute the instruction following the Then if condexpr is True. Otherwise, execute the instruction following the Else. The Else portion is optional.
Form 2: The multiple line if is useful for complex ifs. Each if condexpr is checked in turn. The first True one causes the following statements to be executed. If all are False then the Else's statements are executed. The ElseIf and Else portions are optional.
Form 3: If objexpr's type is the same type or a type descended from objtype the Then portion is executed.
|
See Also
| |
Example
|
|