|
|
|
|
|
|
|
|
Contrast Elseif With Nested If
|
|
|
|
|
|
|
|
v |
ElseIf
is not a nested test as seen before, though it is
|
|
similar
|
|
|
|
|
|
|
|
|
|
|
|
|
If txtNum.Text = 1 Then
|
|
MsgBox(“John”)
|
|
|
ElseIf txtNum.Text = 2 Then
|
MsgBox(“Paul”)
|
|
ElseIf txtNum.Text = 3 Then
|
MsgBox(“George”)
|
|
|
ElseIf txtNum.Text = 4 Then
|
MsgBox(“Ringo”)
|
|
Else
|
|
MsgBox(“Who?”)
|
|
|
End
If
|
|
|
|
|