Code: Select all
CreatePreferences("1.ini")
WritePreferenceString("Key","Value")
ClosePreferences()
Code: Select all
CreatePreferences("1.ini")
WritePreferenceString("Key","Value")
ClosePreferences()
Looks like this one has been around for awhile, I was able to replicate in PB 5.11 (x64) on Win7.Korolev Michael wrote:When compiled in Unicode mode, creates redundant #CRLF$ sequence in start of preference file.Code: Select all
CreatePreferences("1.ini") WritePreferenceString("Key","Value") ClosePreferences()
Ah, makes sense. These guys are GOOD!freak wrote:It is on purpose. The file starts with an UTF-8 byte order mark because preferences are written as UTF-8 in unicode mode. The newline is there so programs that don't understand the BOM don't confuse it as part of the first key.
Code: Select all
[Group_1]
Key0=Value0
Key2=Value2
[Group_2]
Key3=Value3
Key3=Value3
Code: Select all
[Group_1]
Key0=Value0
Key2=Value2
[Group_2]
Key3=Value3
Key3=Value3
lol? You are using a build-in-feature ... that is designed to work withKorolev Michael wrote:It's MY config for MY program. So, why do I need to make hacks for "programs that don't understand the BOM", as @freak said?
Does this affects your program, will the world end if you'll have an additional blank line in there? I mean most feature requests are "valid-ish", but this one seems to be just nitpicking on something that 99.9% perhaps haven't even noticed. If you really need to remove that blank line why not just open the file and remove the first line manually using the file access library commands. Sorry, but to me this request just seems a waste of PB developers time they can rather be spending implementing more great new functionality and fixing bugs.Korolev Michael wrote:Fred, I propose to make for CreatePreferences() an optional flag, something like #PB_Preference_FirstLineEmpty
Why should some one else do something for you, ifKorolev Michael wrote:Agreed, it's not-a-bug.
@PMV I don't have much time to invent my own wheel. There is standard function and we can make it better, isn't it?