Shoutbox

SetControlText \n Help! - 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: SetControlText \n Help! (/showthread.php?tid=82498)

SetControlText \n Help! by Suxsem on 03-20-2008 at 01:04 PM

Hi!
i have an EditControl with this attributes:
<WantReturn>true</WantReturn>
<Multiline>true</Multiline>
if I write an return in this EditControl, when I go GetControlText the return is indicate with "\n"
but if a go fin.SetControlText('IDControl',"line1\nline2") the text is displayed in one line and the "\n" char is displayed with a square.
Help please!
(sorry for bad english :()


RE: SetControlText \n Help! by Spunky on 03-20-2008 at 01:14 PM

I noticed this before. New lines don't work in RichEditControls or RichStaticControls. I classed it as a limitation


RE: SetControlText \n Help! by markee on 03-20-2008 at 01:18 PM

I believe you need to change it to fin.SetControlText('IDControl',"line1\r\nline2").  The \r is a carage return while \n is a new line character.  This i a difference between unix/linux and windows based systems.  Windows uses \r\n with new lines (unix/linux uses just \n...).  If this doesn't work then could you please give use some more of your code and the code for the control so that we can test it ourselves to help you further.


RE: SetControlText \n Help! by Suxsem on 03-20-2008 at 01:23 PM

Very Thank!!!
wtih \r\n is all ok!
bye!