Code: Select all
[MAIN]
String = / readpreference string trim the space before /.
Is this a bug?
Code: Select all
[MAIN]
String = / 
Code: Select all
If OpenPreferences("C:\1.ini")
PreferenceGroup("MAIN")
Debug "|" + Trim(ReadPreferenceString("String", ""), ~"\"") + "|"
ClosePreferences()
EndIfCode: Select all
[MAIN]
String = " / "Thank's for answeer, but this is only a workaround, simple to do but not solve the question, why readpreference trim all spaces at left of string? i think this is not normalAZJIO wrote: Fri Sep 06, 2024 1:34 amCode: Select all
If OpenPreferences("C:\1.ini") PreferenceGroup("MAIN") Debug "|" + Trim(ReadPreferenceString("String", ""), ~"\"") + "|" ClosePreferences() EndIfCode: Select all
[MAIN] String = " / "

Code: Select all
'Keyword = Value' syntax
Code: Select all
WritePreferenceString("Key", #DQUOTE$ + Value$ + #DQUOTE$)

There is an old solution for this old problem: You can escape any #DQUOTE$ in your data.BarryG wrote: It depends if your value contains #DQUOTE$ as well.
Code: Select all
Keyname = " " """ " "
So true, and indeed it's what I do.Little John wrote: Sat Sep 07, 2024 1:48 pmIt's your program and your PREFS file – you can do whatever fits your needs.
does it work as fast? Are you using regular expressions or character-by-character analysis?