I want to pass a message received from a conversation to my DLL.
However, it seems that breaklines won't get passed to my DLL
So if the message received contains breaklines, they won't reach my DLL...
So I thought, ok, let's try something else.
I thought of replacing the breaklines with something else (like <br> for example or something similar) and then send the message to my dll, and then my dll replaces again <br> to a breakline.
When I tried that, it didn't seem to work.
The breakline wasn't being replaced for some reason, and the message was still being shown with the breaklines instead of the replaced text...
So, I went to the irc scripting help channel, and asked if the code I was using was correct.
Let me post the whole part of the log regarding this:
quote:
Originally posted by #msgplus.script on msgplus.irc.net
[14:08:18] <Mike2> shouldn't this change all breaklines to <br> ?
[14:08:18] <Mike2> tmp = tmp.replace(/\n/g, "<br>");
[14:08:42] <borna> yes it should
[14:08:53] <Mike2> it doesn't work for me :/
[14:09:07] <Mike2> i do then Debug.Trace(tmp)
[14:09:12] <Mike2> but i still get breaklines
[14:09:30] <A06> tmp = tmp.replace('\\n', "<br>");
[14:09:51] <borna> try using 2 lines
[14:09:53] * Z1mmE has joined #msgplus.script
[14:10:01] * gifpaste sets mode: +l 36
[14:10:02] <borna> replace each with one line of code
[14:10:09] <Mike2> nope a06
[14:10:12] <Mike2> doesnt work
[14:10:20] <Mike2> what do you mean borna?
[14:10:31] <borna> well if what a06 said dont work than mine wont either
[14:10:37] * ZimmE has quit IRC (Ping timeout)
[14:10:55] <A06> tmp = tmp.replace("\\n", "<br>");
[14:11:16] <turex> mike help me
[14:11:42] <Mike2> doesnt work A06
[14:12:34] * Guest44 has quit IRC (Quit: www.msgpluslive.net)
[14:12:36] <borna> what a06 said should definatly work
[14:13:05] * turex has quit IRC (Quit: )
[14:13:21] <Mike2> nope
[14:13:42] <borna> hmm
[14:13:45] <borna> ill try it for you
[14:13:55] <Mike2> ok, thanks
[14:13:55] <borna> where are you getting your string data
[14:13:55] * Z1mmE has quit IRC (Ping timeout)
[14:14:00] <borna> from btw
[14:14:02] * gifpaste sets mode: +l 32
[14:14:03] <A06> borna
[14:14:08] <borna> yep
[14:14:10] <Mike2> from OnEvent_ChatWndReceiveMessage
[14:14:12] <borna> ^^
[14:14:13] <Mike2> the Message parametr
[14:16:37] <A06> tmp = tmp.replace(/\n/,"<br>");
[14:17:10] <Mike2> nope
[14:17:57] * Z1mmE has joined #msgplus.script
[14:19:32] <A06> hum
[14:19:53] <borna> the kids right
[14:19:54] <borna> i tried it
[14:20:06] <borna> well not the last one i tried the "\\n"
[14:20:14] <borna> that one dont work although it logically should
[14:20:49] <A06> yea
[14:21:06] <borna> and tmp = tmp.replace(/\n/,"<br>");
[14:21:11] <borna> no luck either
[14:21:12] <borna> thats odd
[14:21:18] <borna> wait wait
[14:21:32] <A06> tmp = MsgPlus.RemoveFormatCodes(tmp);
[14:21:37] <A06> tmp = tmp.replace(/\n/,"<br>");
[14:21:58] <borna> thats what i was gonna say
[14:22:03] <borna> use the plus remove format codes
[14:22:07] <borna> but that will remove everything
[14:22:20] <Mike2> but there are no format codes on my message
[14:22:24] <Mike2> but lets try that
[14:22:27] * [TnJ]Baffo has joined #msgplus.script
[14:22:29] <[TnJ]Baffo> hi
[14:23:15] <borna> or umm
[14:23:18] <Mike2> removing format codes didnt work
[14:23:19] <borna> cant you convert them
[14:23:22] <borna> into another type
[14:23:28] <borna> that should remove the \n i think too
[14:23:31] <borna> not so sure though
[14:24:02] * gifpaste sets mode: +l 34
[14:24:59] <Mike2> i still need the breakline
[14:25:03] <Mike2> just as some "text"
[14:25:07] <Mike2> you know what i mean right?
[14:25:16] <Mike2> it seems that when i pass the message to a dll i made
[14:25:22] <Mike2> breaklines are lost :/
[14:25:44] <Mike2> so i'm replacing them to something else
[14:25:57] <Mike2> and I will replace them again to breaklines in my dll
I tried what I had been suggested, but as you can see, it didnt work...
And as you can see, someone else tried, and he also couldn't get it working...
So is this a bug, or am I doing something wrong?