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


Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Linebreaks for notepads

Linebreaks for notepads

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


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

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Wed 08 Dec 2004 08:13 AM (UTC)
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 Nick Gammon   Australia  (23,042 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Wed 08 Dec 2004 08:19 PM (UTC)
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 Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #3 on Wed 08 Dec 2004 09:30 PM (UTC)
Message
Isn't there a function for that?

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

Posted by Jestre   (13 posts)  [Biography] bio
Date Reply #4 on Thu 09 Dec 2004 02:24 AM (UTC)
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 Nick Gammon   Australia  (23,042 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 09 Dec 2004 02:58 AM (UTC)
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 Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #6 on Thu 09 Dec 2004 10:52 PM (UTC)
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 Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #7 on Thu 09 Dec 2004 11:11 PM (UTC)
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 Nick Gammon   Australia  (23,042 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Fri 10 Dec 2004 01:22 AM (UTC)
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

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.


21,192 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]