Nicer Messages

Have you tried displaying long messages, and found that WIL didn't wrap the lines quite the way you wanted? Here are a couple of tricks.

@CRLF

@TAB

 

@CRLF and @TAB are string constants containing, respectively, a carriage-return line-feed pair and a tab character.

We want to be able to insert a carriage return/line feed combination at the end of each line in our output, and the @CRLF string constant will let us do that.. For example, let's say we want to do this:

Message("", "This is line one This is line two")

 

If we just inserted the variables into the string, as in:

Message("", "This is line one @crlf This is line two")

we would not get the desired effect. WIL would simply treat it as ordinary text:

 

image\tutbut13_shg.gif

 

However, WIL does provide us with a method of performing variable and string constant substitution such as this, and that is by delimiting the variables or string constants with percentage signs (%). If we do this:

Message("", "This is line one%@crlf%This is line two")

we will get what we want:

 

image\tutbut14_shg.gif

 

Note that there is no space after %@crlf%; this is so that the second line will be aligned with the first line (every space within the delimiting quote marks of a string variable is significant).