ErosOlmi
08-08-2007, 12:17
Hi all,
I've spent almost an hour getting crazy why INI_GetKey (http://www.thinbasic.com/public/products/thinBasic/help/html/ini_getkey.htm) not working anymore.
I've got a message from Bevan stating that he created a CLOCK.INI file in the same directory of thinBasic script he is doing and he was not able to read any of the keys inside that ini file while he was perfectly able to use INI_GetSectionsList or INI_GetSectionKeyList function. I made some tests and Bevan was right. So a simple
INI_GetKey(app_sourcepath & "Clock.ini", "Setup", "Mininumpregametime", "")
was not returning anything.
The difference between INI_GetSectionsList or INI_GetSectionKeyList function and INI_GetKey is that INI_GetSectionsList and INI_GetSectionKeyList are home made functions while INI_GetKey is a wrapper of GetPrivateProfileString (http://msdn2.microsoft.com/en-us/library/ms724353.aspx) API function.
To get it short, the problem seems ini file name. If ini file name is "CLOCK.INI" GetPrivateProfileString seems to try to take data from somewhere else file or place while using something like the following where ini file name is NOT CLOCK.INI:
INI_GetKey(app_sourcepath & "_Clock.ini", "Setup", "Mininumpregametime", "")
all is working as expected. Note that here we are specifing full ini file path and not just the file name so no way to confuse with other files around.
Does anyone have an idea why? I was not able to find info on Microsoft docs. At this point I suppose CLOCK.INI is a reserved name.
Thanks
Eros
I've spent almost an hour getting crazy why INI_GetKey (http://www.thinbasic.com/public/products/thinBasic/help/html/ini_getkey.htm) not working anymore.
I've got a message from Bevan stating that he created a CLOCK.INI file in the same directory of thinBasic script he is doing and he was not able to read any of the keys inside that ini file while he was perfectly able to use INI_GetSectionsList or INI_GetSectionKeyList function. I made some tests and Bevan was right. So a simple
INI_GetKey(app_sourcepath & "Clock.ini", "Setup", "Mininumpregametime", "")
was not returning anything.
The difference between INI_GetSectionsList or INI_GetSectionKeyList function and INI_GetKey is that INI_GetSectionsList and INI_GetSectionKeyList are home made functions while INI_GetKey is a wrapper of GetPrivateProfileString (http://msdn2.microsoft.com/en-us/library/ms724353.aspx) API function.
To get it short, the problem seems ini file name. If ini file name is "CLOCK.INI" GetPrivateProfileString seems to try to take data from somewhere else file or place while using something like the following where ini file name is NOT CLOCK.INI:
INI_GetKey(app_sourcepath & "_Clock.ini", "Setup", "Mininumpregametime", "")
all is working as expected. Note that here we are specifing full ini file path and not just the file name so no way to confuse with other files around.
Does anyone have an idea why? I was not able to find info on Microsoft docs. At this point I suppose CLOCK.INI is a reserved name.
Thanks
Eros