PDA

View Full Version : Quick one..line break


rhosk
12-11-2003, 04:48 AM
How does one insert a line-break/new line in a message dialog?

Worm
12-11-2003, 06:19 AM
\n -- Should do it.

Or

\13\10 -- Would do a Carriage Return (ASCII Char 13), LineFeed (ASCII Char 10)

Worm
12-11-2003, 06:22 AM
As a side note, for those that need to have a quotation mark(s) in their string, instead of doing the escape sequence like this:

"\"" .. "Worm" .. "\"" -> "Worm"

You can do this:

"\34Worm\34" -> "Worm"

Total preference here, but I think the second one is easier to read.

rhosk
12-11-2003, 06:29 AM
Thanks Worm, good stuff!

Brett
12-11-2003, 07:04 AM
The best way to break a line is usually "\r\n"

kpsmith
12-11-2003, 09:12 AM
I personally like use the double square brackets [[Text here]]

result = Dialog.Message("Notice", [["Your message
here."]], MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

This will display a dialog like:

"Your message
here"

It formats just like you type.

Lorne
12-11-2003, 10:40 AM
kpsmith: Way to get intimate with the language. :)

Worm: You can also include double-quotes in a string by enclosing the string in single-quotes.

Instead of this:

"\"Worm\"" -> "Worm"

You can use this:

'"Worm"'

kpsmith
12-11-2003, 08:30 PM
Yep.. I've been cramming for the scripting test. Printed the scripting guide, highlighted, underlined, made notes and must of read the thing front to back at least 3 times now.

My biggest fear... if I stop I'll forget it all.

Yeah, I need to get a life.

HAZ
12-15-2004, 02:16 PM
thanks for this thread --- answered the question perfectly...

\r\n worked like a charm.

longedge
12-15-2004, 03:06 PM
if I stop I'll forget it all

No no don't stop - I need you to be as knowledgeable as possible :D

yosik
12-15-2004, 04:24 PM
kpsmith,
I did the same. Print it and read it over and over again. Then, I can use it when necesary.
So many programs, so many languages, so many keyboard shorcuts.....

Yossi

TJ_Tigger
12-15-2004, 07:43 PM
I did the same thing and try to remember all that is in the scripting guide. I also read on www.lua-users.org/wiki for lua code. In particular, string functions that are not in AMS.

Tigg