Archive: WriteINIStr with unpaired value


WriteINIStr with unpaired value
Does anyone know how to write a simple string to an ini file? I am trying to a value without the =xxxx. That may just point out that the ini file is being used improperly but in this case I don't have control over the format of the ini file. I am guessing that I could also use a file write, but in that case I would have to locate the proper section.

Thanks,

David Morris


http://forums.winamp.com/showthread....hreadid=128404

This topic should help (read my post at the bottom)

Maybe you can use that instead.


-Stuart


That's actually a bug. You are supposed to be able to write an empty string as a value. I will fix this ASAP.


Done.


With your fix, I can write out a value as:
[somesection]
myvalue=
[nextsection]

but what I actaully need is to write out:
[somesection]
myvalue
[nextsection]...

It could be that the program I am working with uses ini files incorrectly, but I don't have any control over the program.

Thanks,

David Morris


That's impossible with WriteINIStr, it's not how INI files are structured. If you want to do it this way you'll have to write manually with FileOpen, FileRead, FileWrite and FileClose.


Thanks for your help, I was going down that path when I got your message and it looks like it will work.

David Morris