TEXT WINDOW COMMANDS

Note: Most of the commands listed below work with windows of
type "text" and also with the "texteditor" control except where
noted.

print #handle, "!cls" ;
This command clears the text window of all text.

print #handle, "!contents varname$";
print #handle, "!contents #handle";
This command has two forms as described above.  The first form
causes the contents of the text window to be replaced with the
contents of varname$, and the second form causes the contents of
the text window to be replaced with the contents of the stream
referenced by #handle.  This second form is useful for reading
large text files quickly into the window.

print #handle, "!contents? string$";
This command returns the entire text of the window.  After this
command is issued, the entire text is contained in the variable
string$.

print #handle, "!copy" ;
This command causes the currently selected text to be copied to
the WINDOWS clipboard.

print #handle, "!cut" ;
This command causes the currently selected text to be cut out of
the text window and copied to the WINDOWS clipboard.

print #handle, "!font fontName pointsize" ; 
This command sets the font of the text window to the specified
name and size.

print #handle, "!line n string$" ;
Returns the text at line n.  In the code above, n is standing in
for a literal number.  If n is less than 1 or greater than the
number of lines the text window contains, then "" (an empty
string) is returned.  After this command is issued, the line's
text is contained in the variable string$.

print #h, "!lines countVar" ;
This command returns the number of lines in the text window,
placing the value into the variable countVar.

print #handle, "!modified? answer$" ;
This command returns a string (either "true" or "false") that
indicates whether any data in the text window has been modified.
The variable answer$ holds this returned string.  This is useful
for checking to see whether to save the contents of the window
before closing it.

print #h, "!origin? columnVar rowVar" ;
This command causes the current text window origin to be
returned.  The origin is the upper left corner of the texteditor
or textwindow.  When a text window is first opened, the result
would be row 1, column 1.  The result is contained in the
variables rowVar and columnVar.

print #handle, "!origin column row" ;
This command forces the origin of the window to be row and
column.  This means that the row and column specified will
appear in the upper left corner of the texteditor or text window.
Row and column must be literal numbers.  To  use variables for
these values, place them outside the quotation marks, preserving
the blank spaces.

print #handle, "!paste" ;
This causes the text in the WINDOWS clipboard (if there is any)
to be pasted into the text window at the current cursor position.

print #handle, "!selectall" ;
This causes everything in the text window to be selected (
highlighted).

print #handle, "!selection? selected$" ;
This command returns the highlighted text from the window.  The
result will be contained in the variable selected$.

print #handle, "!setfocus";
This causes Windows to give input focus to this control. This
means that, if some other control in the same window was
highlighted and active, this control now becomes the highlighted
and active control, receiving keyboard input.

print #handle, "!trapclose branchLabel" ; 
This command tells Just BASIC to continue execution of the
program at branchLabel if the user double clicks on the system
menu box or pulls down the system menu and selects "close."
