程序代码如下,为实现以上功能,请在横线处填写合适的代码:
Dim jf(800) As Integer, hyh(800) As String, n As Integer
Dim n As Integer ′表示会员的总人数
Private Sub Form_Load()
′从数据库中读取会员编号和积分,并按积分值从小到大排序,显示在列表框List1中
For i=1 To n
List1.AddItem hyh(i)+“ ”+Str(jf(i))
Next i
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, m As Integer, k1 As Integer, k2 As Integer
k1=Val(Text1.Text): k2=Val(Text2.Text)
If k1 > k2 Then t=k1: k1=k2: k2=t
If k1 > jf(n) Or k2 < jf(1) Then
List2.AddItem “没有找到该范围的数据!”
Text3.Text=“0”: Exit Sub
End If
i=1
j=n
Do While i <= j
m=Int((i+j) / 2)
If jf(m) > k1 Then
j=m - 1
ElseIf jf(m) < k1 Then
i=m+1
Else
If Then
j=m - 1
Else
p=m
Exit Do
End If
End If
Loop
If i > j Then p =
k=0
Do While And p <= n
List2.AddItem hyh(p)+ “ ”+Str(jf(p))
p=p+1
Loop
Text3.Text=Str(k)0
End Sub