[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Linebreaks for notepads

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Linebreaks for notepads
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 10 Dec 2004 01:22 AM (UTC)  quote  ]
Message
Yes, that will work. It is the documentation stuff. I think I have fixed it now, will be updated in the next release.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Thu 09 Dec 2004 11:11 PM (UTC)  quote  ]
Message
AppendToNotepad("test", "Stuff\r\nMore stuff\n")

Works for me.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Thu 09 Dec 2004 10:52 PM (UTC)  quote  ]
Message
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.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 09 Dec 2004 02:58 AM (UTC)  quote  ]
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Jestre   (13 posts)  [Biography] bio
Date Thu 09 Dec 2004 02:24 AM (UTC)  quote  ]
Message
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.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Wed 08 Dec 2004 09:30 PM (UTC)  quote  ]
Message
Isn't there a function for that?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 08 Dec 2004 08:19 PM (UTC)  quote  ]
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Wed 08 Dec 2004 08:13 AM (UTC)  quote  ]
Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Jestre   (13 posts)  [Biography] bio
Date Wed 08 Dec 2004 07:41 AM (UTC)  quote  ]
Message
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.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,708 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]