VB中显示块IF没有END IF 10
PrivateSubCommand1_Click()DimxAsIntegerIfx>=90ThenText2.Text="A等"ElseIfx>=80ThenText2...
Private Sub Command1_Click()
Dim x As Integer
If x >= 90 Then
Text2.Text = "A等"
Else
If x >= 80 Then
Text2.Text = "B等"
Else
If x >= 60 Then
Text2.Text = "C等"
Else
If x < 60 Then
Text2.Text = "E等"
End If
End If
End If
End Sub 展开
Dim x As Integer
If x >= 90 Then
Text2.Text = "A等"
Else
If x >= 80 Then
Text2.Text = "B等"
Else
If x >= 60 Then
Text2.Text = "C等"
Else
If x < 60 Then
Text2.Text = "E等"
End If
End If
End If
End Sub 展开
2个回答
展开全部
写漏了一个End If,请参见以下代码:
Private Sub Command1_Click()
Dim x As Integer
If x >= 90 Then
Text2.Text = "A等"
Else
If x >= 80 Then
Text2.Text = "B等"
Else
If x >= 60 Then
Text2.Text = "C等"
Else
If x < 60 Then
Text2.Text = "E等"
End If
End If ' 这里漏了个End If
End If
End If
End Sub
请留意代码里,变量x未赋值,请补上赋值代码,否则变量x将恒为0
Private Sub Command1_Click()
Dim x As Integer
If x >= 90 Then
Text2.Text = "A等"
Else
If x >= 80 Then
Text2.Text = "B等"
Else
If x >= 60 Then
Text2.Text = "C等"
Else
If x < 60 Then
Text2.Text = "E等"
End If
End If ' 这里漏了个End If
End If
End If
End Sub
请留意代码里,变量x未赋值,请补上赋值代码,否则变量x将恒为0
展开全部
Private Sub Command1_Click()
Dim x As Integer
If x >= 90 Then
Text2.Text = "A等"
ElseIf x >= 80 Then
Text2.Text = "B等"
ElseIf x >= 60 Then
Text2.Text = "C等"
ElseIf x < 60 Then
Text2.Text = "E等"
End If
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询