Use Function Filter in VB6
Use Function Filter in VB6
Rate Use Function Filter in VB6
(2(2 Vote))
'be cleared. To test the code, enter "abcabcabc" in txtText and click cmdFilter
'three times to see the result.
'Function Filter has more powerful functionality applied to database data. See
'VB help for more detailed info.
Private Sub cmdFilter_Click()
'
Dim I As Integer
Dim sReturnArray() As String
Dim saTest() As String
Dim sInput As String
Dim sFirstChar As String
Dim sFiltered As String
'
'
sInput = txtTest.Text
'
ReDim saTest(Len(sInput) - 1)
'
For I = 0 To (Len(sInput) - 1)
saTest(I) = Mid(sInput, I + 1, 1)
Next I
'
sFirstChar = Mid(sInput, 1, 1)
'
sReturnArray() = Filter(saTest, sFirstChar, False, vbTextCompare)
'
For I = 0 To UBound(sReturnArray)
sFiltered = sFiltered & sReturnArray(I)
Next I
'
txtTest.Text = sFiltered
'
End Sub
Use Function Filter in VB6 Comments
No comments yet — be the first to post one!
Post a Comment