| |

VerySource

 Forgot password?
 Register
Search
View: 949|Reply: 3

What is wrong with this code? Thank you

[Copy link]

8

Threads

19

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-9-28 20:30:01
| Show all posts |Read mode
Private Sub Command1_Click()
Dim s As Integer
s = Text1.Text
If s Mod 3 = 0 Then x = MsgBox("It is a multiple of 3", vbOKOnly, "Value judgment")
Else: If s Mod 3 <> 0 Then x = MsgBox("Not a multiple of 3", vbOKOnly, "Numerical judgment")
End If
End Sub

Anyway, it cannot be executed
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-28 20:45:01
| Show all posts
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
Reply

Use magic Report

8

Threads

19

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-9-28 22:30:02
| Show all posts
The one upstairs is sorry, your one is also wrong. Prompt that else there is no if
Reply

Use magic Report

0

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-9-28 23:00:01
| Show all posts
Private Sub Command1_Click()
Dim s As Integer
s = Text1.Text
If s Mod 3 = 0 Then x = MsgBox("It is a multiple of 3", vbOKOnly, "Value judgment")
If s Mod 3 <> 0 Then x = MsgBox("Not a multiple of 3", vbOKOnly, "Value judgment")
End Sub
that's it
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list