VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Use Function Filter in VB6

by Yuening Dai (30 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 9th January 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Use Function Filter in VB6

Rate Use Function Filter in VB6



'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

Download this snippet    Add to My Saved Code

Use Function Filter in VB6 Comments

No comments have been posted about Use Function Filter in VB6. Why not be the first to post a comment about Use Function Filter in VB6.

Post your comment

Subject:
Message:
0/1000 characters