i am starting to get the hang of vb6, but are stuck trying to use this public sub in a class from a form. I am trying to search for a key. i have been able to save to the ini file, but do not know how to use this:
Code:
Public Sub EnumerateCurrentSection(ByRef sKey() As String, ByRef iCount As Long)
        Dim sSection As String
        Dim iPos     As Long
        Dim iNextPos As Long
        Dim sCur     As String
   
    iCount = 0
    Erase sKey
    sSection = INISection
    If (Len(sSection) > 0) Then
        iPos = 1
        iNextPos = InStr(iPos, sSection, Chr$(0))
        Do While iNextPos <> 0
            sCur = Mid$(sSection, iPos, (iNextPos - iPos))
            If (sCur <> Chr$(0)) Then
                iCount = iCount + 1
                ReDim Preserve sKey(1 To iCount) As String
                sKey(iCount) = Mid$(sSection, iPos, (iNextPos - iPos))
                iPos = iNextPos + 1
                iNextPos = InStr(iPos, sSection, Chr$(0))
            End If
        Loop
    End If
 
End Sub