I have never used the integrated INI functions, and now im trying to make them work.
When i use this:
FF_INI_SetKey(FileName, "MAIN", "PATH", FilePath)
I get an empty ini file. do i need to add the sections manually before adding items or something like that? If so, how?
Thanx in advance.
Im guessing this features are for modifying already existing ini files, instead of create new ones?
Hi Elias,
I use the integrated INI functions since my first FireFly program without any problem.
The only tip that I can give you is to precise the full filename for the ini file; to do that I compose the filename with the CurDir$ function; see the example below.
Hope it helps.
Local lINI As String : lINI = CurDir$+"\"+"PingMyIpAddresses.ini"
FF_INI_SetKey(lINI, "General", "TimeOut", FF_TextBox_GetText (HWND_PINGMYIPADDRESSES_SECONDES))
Jean-Pierre
Hello,
This is what I always do. I always call my ini file the same as my exe file.
Local sIniFile As String
sIniFile = app.Path & Left$(app.EXEName,Len(app.EXEName)-4) & ".ini"
g_Vemado2009Ini.DbaseDir = FF_INI_GetKey (sIniFile, "Folders", "Database" , "Database")
Saving/writing INI files to the program or current directory is asking for trouble on Windows Vista (and possibly XP if tweaked for IT security). Try using the CSIDL info to find a safe path no matter what operating system you are using:
http://visualstudiomagazine.com/columns/article.aspx?editorialsid=2962
Its not working with me guys. Would you be so kind of posting a small example
of how to create an ini file and add a simple key?
Put this code in FORM1_WM_CREATE:
Local IniFile As String
'create new INI-File
IniFile = APP.Path & "myfile.ini"
FF_INI_SetKey (IniFile, "PROGRAMM", "DATA", "12345")
'read the new INI-File
If FF_INI_KeyExists(IniFile, "PROGRAMM", "DATA") Then
MsgBox "The Key: " & FF_INI_GetKey (IniFile, "PROGRAMM", "DATA", "-")
Else
MsgBox "Key's not existing"
End If
I hope this helps.
Rudolf Fürstauer
I was expecting that the setkey command created something like:
Keyname=
When the key contents were an empty string. :)
Thanx! This works like a charm. :)