前回活動を行いました。同級生のpythonコードをvbに変換していました...これが私の最終的なコードであり、実行中です。
Private Sub txtInput_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
curyear = Int(2013)
a = Int((curyear - txtInput.Text) Mod 12)
txtInput.Text = " "
If (a = 9) Or (a = -3) Then
txtOutput.Text = "Your zodiac sign is Snake"
ElseIf (a = 8) Or (a = -4) Then
txtOutput.Text = "Your zodiac sign is Dragon"
ElseIf (a = 7) Or (a = -5) Then
txtOutput.Text = "Your zodiac sign is Rabbit"
ElseIf (a = 6) Or (a = -6) Then
txtOutput.Text = "Your zodiac sign is Tiger"
ElseIf (a = 5) Or (a = -7) Then
txtOutput.Text = "Your zodiac sign is Ox"
ElseIf (a = 4) Or (a = -8) Then
txtOutput.Text = "Your zodiac sign is Rat"
ElseIf (a = 3) Or (a = -9) Then
txtOutput.Text = "Your zodiac sign is Pig"
ElseIf (a = 2) Or (a = -10) Then
txtOutput.Text = "Your zodiac sign is Dog"
ElseIf (a = 1) Or (a = -11) Then
txtOutput.Text = "Your zodiac sign is Rooster"
ElseIf (a = 0) Or (a = -2) Then
txtOutput.Text = "Your zodiac sign is Monkey"
ElseIf (a = 11) Or (a = -1) Then
txtOutput.Text = "Your zodiac sign is Sheep"
ElseIf (a = 12) Or (a = 0) Then
txtOutput.Text = "Your zodiac sign is Horse"
End If
End If
End Sub
私たちの教授は ascii 13/enter の他の使い方について教えてくれました... 私は彼をよく理解できません。私のコードのどこが間違っていると思いますか? 実行中ですが、彼は私のコードが間違っていると言いました。