ini file reading

ini file reading

Anonymous
Not applicable
260 Views
2 Replies
Message 1 of 3

ini file reading

Anonymous
Not applicable
Hi,

We are working with ini files, so all of the info about projects are in that
ini file. I found a module on the internet which helps me to read (write and
delete) parts of the ini file. It works the same as GetSetting/SaveSetting
for registry reading/writing.

In my ini file there is a key that has more then one value, seperated by a
",". Can anyone tell me how to get the second, third, fourth and so on
value?

Frank
0 Likes
261 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Use the split function. Below is an example.

Tim Riley

*************Code********************

Option Explicit

Public Sub test()
Dim strINI As String
Dim strSplit() As String
Dim I As Integer

strINI = "Yup,This,is,a,string"
strSplit = Split(strINI, Chr(44))

For I = LBound(strSplit) To UBound(strSplit)
MsgBox strSplit(I)
Next

End Sub
0 Likes
Message 3 of 3

Anonymous
Not applicable
Frank,

For working with INIs, save yourself the work and use the Win32 API - it
has built-in functionality for what you are doing. Check out VBNet for
beginners, intermed and advanced tutorials/example code [watch for word
wrap]:

http://www.mvps.org/vbnet/index.html?code/fileapi/filedatetime.htm

___________________________
Mike Tuersley
AutoCAD Clinic
Rand IMAGINiT Technologies
0 Likes