105
<TW>
Text Wrap
Attributes
Description
Force text that cannot fit on the current line, to be written on the next line
Parameters
None
Initial Value
<NA> No Align
Modes
Row Mode only
Notes
This attributes forces any text that will not fit on the current line to be written on the following line.
The operation is not intelligent in any way, the decision of whether to wrap to the next line is made
on a character by character basis. This means words will usually flow across two lines.
Text written off the end of the bottom line will cause the screen to scroll.
The Text Wrap attribute may be used with the whole screen or constrained within a window.
It is cancelled by the <NA> No Align command.
Text that exceeds the line length without either the <TW> or <SW> attributes set will not be written
to the screen and an error is returned to the host.
Uses
The <TW> command allows:
•
Strings can be sent without worrying about their length
•
Maximum visible message size, albeit with poor formatting
Example
<SD>
Set the display to a known state
<CM3,0>
Cursor Move to line 3
<TW>
Set Text Wrap attribute
<WTThis text
exceeds the line
length>
Send a long line of text, which exceeds the screen width
Note that all the text is displayed without an error being returned to
the host, but the word “the” is split on to two lines.
<NA>
Cancel Text Wrap
<CM3,0>
Move back to the same starting point
<WTThis is a long
line of text that
wraps on to three
rows>
Send another long line of text, which exceeds the screen width
This time the first line is overwritten, but the second line is not
because the text has not been wrapped.
Also, an error response is returned to the host to indicate that the
write command failed
Gotchas!
If text needs to wrap, but without splitting words, use the <SW> attribute instead.
See Also
NA
No Align
SW
Smart Wrap