Page 1 of 1

Preference issue?

Posted: Thu Mar 06, 2008 9:30 pm
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

Posted: Thu Mar 06, 2008 9:39 pm
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?

Change editor from japbe to pb...

Posted: Thu Mar 06, 2008 10:12 pm
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