Wrapping lines in messages
Keywords: wrapping lines message boxes CRLF carriage return Num2char StrCat
How do I get my long lines to wrap to the next line?
Answer:
Here's one way:CRLF=@CRLF Message ("Title","Line 1.%CRLF%Line 2.") Display (5,"Title","Line 1.%CRLF%Line 2.")You can do it like this too:Message ("Title","Line 1.%@CRLF%Line 2.")Or, here's another way:line1="Hello there" line2="GoodBye" Message("Test",strcat(line1,@crlf,line2))Here's the old-fashioned way, using the built in @crlf and @tab string constants. Use the functions Num2Char or StrCat to accomplish this.cr=Num2Char(13) ; 13 is a carriage-return lf=Num2Char(10) ; 10 is a line feed Message("", "This is line one %cr% %lf% This is line two")or...cr=Num2Char(13) lf=Num2Char(10) crlf=StrCat(cr, lf) Message("", "This is line one %crlf% This is line two")Note: @crlf and @tab are explained in more detail in the WIL Tutorial section under the heading, "Nicer Messages."
How to Bring in an @crlf from the Clipboard
Question:
I want to bring in a @crlf from the clipboard and pass that onto the BoxOpen function. How do I do that?Answer:
In the following example, "Hello %@crlf% world" is copied to the clipboard. Then we replace %%@crlf%% with two percents, so that substition doesn't happen immediately.;Hello %@crlf% world ;this string (without semi-colons) copied to clipboard param1=clipget() param1=StrReplace(param1,"%%@crlf%%",@crlf) count = itemcount(param1, " ") for i=1 to count item%i%=itemextract(i, param1, " ") message("", item%i%) next ;item2 is the @crlf parameter BoxOpen('my title', strcat(item1, item2, item3)) Timedelay(5) BoxShut()
Article ID: W13008Filename: Wrapping lines in Message Boxes.txt