What are ini files?

Blitz3D Forums/Blitz3D Beginners Area/What are ini files?

Using Ini files as a Limited *DataBase*...
Ini files are basically INDEXED files not text files..
Main Key= Section Name
Sub Key = Section Detail (You can create this key)
e.g.,
Assume you want to store the *Last Played* data for each person who has used your app..
want to keep..Date played,mins played, highest score...

[MyAppPlayed] ---- Section Name/Key
Tommy Roe=20040507,45 Mins,Score 125 (Key is Tommy Roe)
Mickey Mouse=20040508,180 Mins,Score 1120
etc,,
API: GetPrivateProfileString("myAppPlayed",
"Tommy Roe",
"Not Found", (Default return)
RtnString,
1024,
"C:\...\MyIniFileName.ini")
returns 20040507,45 Mins,Score 125
You would have to parse out the CSV fields (assuming you have more than one)

The API can also return All sub keys to allow you to loop through them... i.e.,
GetPrivateProfileString("myAppPlayed",
Null,
"Not Found", (Default return)
RtnString,
1024,
"C:\...\MyIniFileName.ini")
rtn String contains Tommy Roe/Null/Mickey Mouse/Null/ etc..

And of Course INI files can contain Many Different Sections. The Only limitation that I can recall is that they (Ini) must be <= 64KB in size...
Store data using the API.. WritePrivateProfileString ...
They are quite easy to use and can be quite powerful if you have the need for simple indexed app..