LfThen Elself Statement

Quite often you will need to check the results of several different conditions. To join a set of If conditions together, you can use the Elself clause. Using the If.. .Then... Elself statement, you can evaluate more conditions than is possible with the If.. .Then.. .Else statement that was the subject of the preceding section. Here's the syntax of the If.. .Then.. .Elself statement:

If conditionl Then statements to be executed if conditionl is True ElseIf condition2 Then statements to be executed if condition2 is True ElseIf condition3 Then statements to be executed if condition3 is True ElseIf conditionN Then statements to be executed if conditionN is True

Else statements to be executed if all conditions are False End If

The Else clause if optional; you can omit it if there are no actions to be executed when all conditions are false.

Part I

0 0

Post a comment