|
How does end if work in the conditional statement of VB? Under what circumstances is it combined with what purpose?
Sometimes an error pops up saying that else does not have an if. Why?
Take the following program:
Private Sub Command1_Click()
Dim s As Integer
s = Text1.Text
If s Mod 3 = 0 Then
x = MsgBox("is a multiple of 3", vbOKOnly, "numerical judgment")
Else
If s Mod 3 <> 0 Then
x = MsgBox("Not a multiple of 3", vbOKOnly, "Value judgment")
End If
End If
End Sub
Who is this end if used in conjunction with, and how can I change it if I don’t need it? Thank you! ! ! |
|