Linebreaks for notepads

Posted by Jestre on Wed 08 Dec 2004 07:41 AM — 9 posts, 31,453 views.

#0
When I use SendToNotepad or AppendToNotepad I can't seem to get it to linebreak. Am I supposed to set what's used for linebreaks somewhere? Or is it supposed to do as the examples? Because they don't work. I use Python as my scripting language.
USA #1
No, you have to add the linebreaks manually using \n (like in the examples).

Well... as the examples should be (these are the examples in the list of inbuilt script functions).
Nick, the examples in the scipt functions dont have the slashes in them.
Australia Forum Administrator #2
MySQL needs quotes to be escaped with backslashes and if you aren't careful you either get too many or too few. It is a nightmare. It is because PHP adds the backslashes for you, if the data comes from a web form, but if it doesn't then you need to do it yourself.
Greece #3
Isn't there a function for that?
#4
Yeah I tried using \n which is python's normal line break and \r, \rn, and \nr just to be sure. All it does is give me a little box but keeps it all on the same line.
Australia Forum Administrator #5
Sure, there's a function to do it. But if you do it too much you get double backslashes, and it depends on whether the data comes from the form, or the database, or some combination of the two. Believe me, I've gone grey trying to do it.
Greece #6
Ah, I see. Can't you use a signal string, for example prepend \n or something rare in front of every string, and check if that is escaped or not? I might be way off here, but just a thought.
USA #7
AppendToNotepad("test", "Stuff\r\nMore stuff\n")

Works for me.
Australia Forum Administrator #8
Yes, that will work. It is the documentation stuff. I think I have fixed it now, will be updated in the next release.