Information générale
Catégorie:
West Wind Web Connection
I am trying to use West Wind's wwAPI to read and write an .INI file. Reading works fine, but writing back to the .INI does not work when I'm trying to update an existing key in the .INI file. It does work if I am adding a new key, but not trying to update an existing key. Does anyone know if the WriteProfileString function will "update" (over right) the value for an existing key? And, if so, how to make it work?
Also, no matter what I pass the function it always returns .T.
Here's an example:
Contents of the INI file:
[MYSECTION]
EXPORTPATH=F:\OURAPP\EXPORT\
I execute the following...
o = CREATEOBJECT("wwApi")
o.WriteProfileString("myini.ini","MYSECTION","EXPORTPATH","F:\SOMEOTHERPATH\EXPORT")
... but the EXPORTPATH entry does not change in the INI.
If I do this ...
o.WriteProfileString("myini.ini","ANOTHERSECTION","EXPORTPATH","F:\SOMEOTHERPATH\EXPORT")
... the INI file then looks like this ...
[MYSECTION]
EXPORTPATH=F:\OURAPP\EXPORT\
[ANOTHERSECTION]
EXPORTPATH=F:\SOMEOTHERPATH\EXPORT\
Thank you.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement