IniReader-klassen är en klass designad för att underlätta läsandet av INI-filer.
Dim I As Integer
'Instansera
Dim IniReader As New clsIniReader
'Ladda en ini-fil (True vid lyckat resultat)
Debug.Print IniReader.Initialize("C:\test.ini")
'Testa om ett värde finns
Debug.Print IniReader.KeyExists("My test section", "My test value")
'Testa hämta ett värde
Debug.Print IniReader.GetValue("My test section", "My test value")
'Hämta en string collection med samtliga sektioner
Dim Sections As Collection
Set Sections = IniReader.GetSections()
If Sections.Count > 0 Then
For I = 1 To Sections.Count
Debug.Print Sections(I)
Next
End If
'Hämta en string collection med samtliga nycklar i en sektion
Dim Keys As Collection
Set Keys = IniReader.GetKeys("My test section")
If Keys.Count > 0 Then
For I = 1 To Keys.Count
Debug.Print Keys(I)
Next
End If