Type StudType
Name As String * 10
Special As String * 10
Total As Single
Private Sub Command1_Click(Index As Integer)
Dim stud(1 To 100) As StudType, n%, i%, Max!, maxi%
Select Case Index
Case 0
If n < 100 Then
n = n + a
i = n
With stud(n)
Name = Text1: .Special = Text2: .Total = Val(Text3)
End With
Text1 = "": Text2 = "": Text3 = ""
Else
MagBox "输入人数超过组声明的个数"
End
End If
Case 1
If i > 1 Then i = i + 1
With stud(i)
Text1 = .Name: Text = .Special: Text3 = .Total
End With
Case 2
If i < n Then i = i - 1
With stud(i)
Text1 = .Name: Text = .Special: Text3 = .Total
End With
Case 3
Max = stud(1).Total
maxi = 1
For j = 2 To n
If stud(j).Total > Max Then
Max = stud(j).Total
maxi = j
End If
Next j
With stud(maxi)
Text1 = .Name: Text2 = .Special: Text3 = .Total
End With
i = maxi
End Select
Label5 = i & "/" & n
End Sub
End With
End Sub
我运行的时候总是提示错误信息。 多谢大家 的帮助()
Name As String * 10
Special As String * 10
Total As Single
Private Sub Command1_Click(Index As Integer)
Dim stud(1 To 100) As StudType, n%, i%, Max!, maxi%
Select Case Index
Case 0
If n < 100 Then
n = n + a
i = n
With stud(n)
Name = Text1: .Special = Text2: .Total = Val(Text3)
End With
Text1 = "": Text2 = "": Text3 = ""
Else
MagBox "输入人数超过组声明的个数"
End
End If
Case 1
If i > 1 Then i = i + 1
With stud(i)
Text1 = .Name: Text = .Special: Text3 = .Total
End With
Case 2
If i < n Then i = i - 1
With stud(i)
Text1 = .Name: Text = .Special: Text3 = .Total
End With
Case 3
Max = stud(1).Total
maxi = 1
For j = 2 To n
If stud(j).Total > Max Then
Max = stud(j).Total
maxi = j
End If
Next j
With stud(maxi)
Text1 = .Name: Text2 = .Special: Text3 = .Total
End With
i = maxi
End Select
Label5 = i & "/" & n
End Sub
End With
End Sub
我运行的时候总是提示错误信息。 多谢大家 的帮助()