O.P. New line problem, when \n doesn't work!
Hi all
I have a problem when I already read messages from XML file.
Each messages combined multi-sentence and "\n" to tell messages go to new line. Then I will send that messages to chat window. The result does not make new line like I planed.
Here is my XML file sample (test.xml)
<root>
<node>Hello, I saw you continuely online more than 60 minutes.\nPlease take a little time to break for your good healthy.\nI'm also apologize for this interupt, this is testing</node>
<node>bra bra...2 \nbra bra..</node>
<node>bra bra...3 \nbra bra..</node>
<node>bra bra...4 \nbra bra..</node>
</root>
Here is my code
function OnEvent_Initialize(MessengerStart)
{
var Email = "sakpong@live.com";
var file = MsgPlus.ScriptFilesPath+"\\test.xml";
var rootXML = XMLNewRequest(file);
var aMsg = rootXML.childNodes.item(0);
var bMsg = "Hello, I saw you continuely online more than 60 minutes.\nPlease take a little time to break for your good healthy.\nI'm also apologize for this interupt, this is testing";
Messenger.OpenChat(Email).EditText_ReplaceSel(aMsg));
}
Here is chat window's result from case that aMsg is read from XML.
Hello, I saw you continuely online more than 60 minutes.\nPlease take a little time to break for your good healthy.\nI'm also apologize for this interupt, this is testing
Here is chat window's result from case that bMsg is string variable.
This result is I want it be. But I can't fixed all data in script like this case.
Hello, I saw you continuely online more than 60 minutes.
Please take a little time to break for your good healthy.
I'm also apologize for this interupt, this is testing
I try to use String()'s function with aMsg but it's still not work.
Someone help me please.
Thank you so much.
Also I attached this test script, but code still be confuse. Because it's in testing and many dummy functions are in code. Also XML data mostly represent in Thai language.
Attachment: XMLtest.plsc (6.22 KB)
This file has been downloaded 105 time(s).
This post was edited on 05-02-2009 at 12:09 AM by Saki.
|