Preference issue?

Just starting out? Need help? Post your questions and find answers here.
DoMi
User
User
Posts: 67
Joined: Sat Jan 10, 2004 5:41 pm
Location: France

Preference issue?

Post by DoMi »

(Using PB 4.20 BETA 2)
Hello
When writing in a preference file (son.txt) I got two more lines
with those characters at the beginning (first line): 
and an empty key/value at the end : =

Whereas there's nothing more than the expected lines in the messagerequester used for testing !?

Code: Select all

Procedure.l modifierFichier()
  PreferenceGroup(GetGadgetText(#cbxTypes))
  For i = 0 To CountGadgetItems(#lstFichiers)-1
    MessageRequester("",Left(GetGadgetItemText(#lstFichiers,i,0),1)+" = "+GetGadgetItemText(#lstFichiers,i,1))
    WritePreferenceString(Left(GetGadgetItemText(#lstFichiers,i,0),1),GetGadgetItemText(#lstFichiers,i,1))
  Next
  isModified = 0
  ProcedureReturn 1
EndProcedure
I got the same with or without Unicode for the editor or the program... :cry:
Any solution or trick?
Thanks in advance for your replies
DoMi
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

No problem here.

In unicode mode the file is written in utf-8 format with a BOM. This BOM probably explains the first line you see - although you shouldn't see this in Ascii mode.

I get no empty key/value pair at the end of the file in any mode! You sure it's not some other part of your code?
I may look like a mule, but I'm not a complete ass.
DoMi
User
User
Posts: 67
Joined: Sat Jan 10, 2004 5:41 pm
Location: France

Change editor from japbe to pb...

Post by DoMi »

many usefull tools with JaPBe but sometimes messy setups...
I came back to the root PureBasic editor and setting the source and compiler to "texte brut" ("plain text") it works now... sorry for the trouble :?

automatic indent, filelists, reloading source option, are missing otherwise I'd never be "unfaithful" to the original and rude editor :wink:

thanks for your fast reply
DoMi
Post Reply