INI File reading

I have a problem reading multiple data from an INI file. I can read one no problem but I keep getting an Error13 if I try to read more than one. Any Help would be appreciated. The code I use in the form to read the single ini data is as follows:

[code]Dim m_oReadINI As CReadINI
Dim sLocation As String

Set m_oReadINI = New CReadINI

'set location of the INI file
sLocation = "C:HomeSettings.ini"

'pass info from CReadINI

With m_oReadINI
.ININame = "C:HomeSettings.ini"
.Section = "Settings"
.Key = "RobotID"
txtRobotID.Text = .ReadINISettings
End With

Set m_oReadINI = Nothing
Exit_FormLoad:
Exit Sub


[/code]

The ini file looks like this and I want to be able to read other values from it.

[code]
[Settings]
Mode=Enabled
RobotID=Robot Controller
DataLink=InfraRed
ComPort=USB
[/code]

I want to be able to read multiple data from different keys etc from this code. How do I do this?? Any help would be appreciated. Thanks.

Thanks.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories