VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1920
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3750
   LinkTopic       =   "Form1"
   ScaleHeight     =   1920
   ScaleWidth      =   3750
   StartUpPosition =   3  '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim b() As Variant

Public Sub Search(a(), ByVal key, index%)
  Dim i%
  For i = LBound(a) To UBound(a)
    If key = a(i) Then
      index = i
      Exit Sub
    End If
  Next i
    index = -1
End Sub

Private Sub Form_Click()
  b = Array(1, 3, 5, 7, 9, 2, 4)
  k = Val(InputBox("指定数据1-5,7,9"))
  Call Search(b, k, n%)
  Print n
End Sub

