The IniReader-class is a class designed to assist in reading of Ini-files.
Dim I As Integer
'Instantiate
Dim IniReader As New clsIniReader
'Load an ini-file(True vid lyckat resultat)
Debug.Print IniReader.Initialize("C:\test.ini")
'Test if a value exists
Debug.Print IniReader.KeyExists("My test section", "My test value")
'Retrive a value
Debug.Print IniReader.GetValue("My test section", "My test value")
'Retrive a collection of all the sections
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
'Retrive a collection of all the keys in a section
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