Shoutbox

NewLine in TextBox - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: NewLine in TextBox (/showthread.php?tid=62786)

NewLine in TextBox by cornetto on 07-07-2006 at 11:01 PM

Hi :)

Well, i save an EditControl value in a XML file.
When i want to load it again in a EditControl, linebreaks don't appear.

What should i do ?


RE: NewLine in TextBox by noroom on 07-10-2006 at 08:44 PM

Replace the linebreaks with a special character, and then when loading the value, replace them back?


RE: NewLine in TextBox by cornetto on 07-10-2006 at 08:46 PM

Yeah but what Special Char ?


It works with RichEditControl.

Thanks "me".....
RE: NewLine in TextBox by CookieRevised on 07-11-2006 at 10:48 PM

XML files are textfiles using HTML tags (roughly speaking).

This means that you must apply to the same rules as for HTML files for storing text. This means that special characters (and even also some normal characters like ">") must be saved as entities when you need to store them inside the XML and convert the entities back when you read them.

For example, line breaks are not valid in XML. You can write all the line breaks you want, it wont be seen as text.

RichEditText can be stored "as-is" (almost!!! thus not entirly, you can/will encounter just the same problems, but with other characters and stuff) because with RichEditText those special characters are already converted to entities and special tags.

You will always need to use a converter if you whish to store data/text in XML and you have no control of what is being stored or you have no certainty that the text will be "safe".