Auto Fill of Combo Box (Part 2) This is the function which I forgot to put in my earlier code
Auto Fill of Combo Box (Part 2) This is the function which I forgot to put in my earlier code
Rate Auto Fill of Combo Box (Part 2) This is the function which I forgot to put in my earlier code
(2(2 Vote))
Dim MidPt As Integer
Dim LoPt As Integer
Dim HiPt As Integer
Dim CmpVal As Integer
LoPt = 0
HiPt = ctlList.ListCount
Do While LoPt < HiPt
MidPt = LoPt + (HiPt - LoPt) \ 2
CmpVal = StrComp(UCase$(left$(ctlList.List(MidPt), Len(szSearch))), UCase$(szSearch))
If CmpVal = 0 Then
Exit Do
ElseIf CmpVal = 1 Then
HiPt = MidPt
Else
LoPt = MidPt + 1
End If
Loop
If CmpVal = 0 Then
Do
MidPt = MidPt - 1
If MidPt < 0 Then
MidPt = 0
Exit Do
End If
If UCase$(left$(ctlList.List(MidPt), Len(szSearch))) <> UCase$(szSearch) Then
MidPt = MidPt + 1
Exit Do
End If
Loop
Else
MidPt = -1
End If
Func_BinaryListSearch = MidPt
End Function
Auto Fill of Combo Box (Part 2) This is the function which I forgot to put in my earlier code Comments
No comments yet — be the first to post one!
Post a Comment