[vb]代码库
Option Explicit
Option Base 1
Dim a(10) As Integer
Dim i As Integer
Private Sub Command1_Click()
For i = 1 To 10
a(i) = Int(90 * Rnd + 10)
Text1 = Text1 & Str(a(i))
If i Mod 5 = 0 Then Text1 = Text1 & Chr(13) & Chr(10)
Next i
End Sub
Private Sub Command2_Click()
Dim x As Integer
x = Val(Text2)
For i = 1 To 10
If a(i) = x Then Exit For
Next i
If i <= 10 Then
Text3 = Str(x) + "在第" + Str(i) + "个位置"
Else
Text3 = "没有找到"
End If
End Sub
Private Sub Command3_Click()
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
Private Sub Command4_Click()
End
End Sub