These commands enable the opening and closing of on-screen
windows.

This is a very powerful feature of Scripta, enabling up to
five separate windows to be open concurrently (six if you
include Scripta's own window; seven if you count the
separate window which is opened automatically by ASK
commands).

Each window may be whole-screen or just a part of the
screen.

You may switch console input and output at will between as
many windows as you have open.

You should imagine your own windows as forming a stack.
When you open a new window, it is added to the top of the
stack but you can move windows about so that the box of
your choice is 'on top'.

The window on the top of the stack is the one which, by
default, will receive any output generated by the INPUT or
MESSAGE commands. It is in any event the only window
guaranteed to be wholly visible on the screen.

Depending on placement, other windows may be totally
visible or may be totally or partially obscured. Windows
can only be obscured by other windows which appear
'higher' up the stack than themselves.

When a window is first opened, it is made fully visible
and is placed on top of the stack so, if the first window
you open is full-screen, the current Scripta window will
be completely obscured until you close your window again.

Scripta will automatically write any data received from
the remote computer at current cursor position in the TOP
window.

You may move the cursor at will and switch it on and off
as you please.

The WRAPON and WRAPOFF commands may be used to change the
current end_of_line wrap policy. The default is ON. When
WRAP is ON, if you send a message which is too long for
the current window, it will be allowed to overflow onto
the next line, causing rack-up if you are currently
positioned on the bottom line of the window. When WRAP is
OFF, lines which are too long are truncated.

The BOXHUES command may be used to change the current
default colours. When a box is opened, it adopts the
current default colours. These may be changed again, at
any time, by using the FORE and BACK commands.

The Scripta System Variable %BOXSTATE returns a 6-byte
string. The first character (character 0) is always a
space character. Character n has the value 'O' if box n
is open or 'C' if box n is closed.

For example, if boxes 1 and 4 are open and the remainder
closed then %BOXSTATE will return the value ' OCCOC'.

OPENBOX n x1 y1 x2 y2 <title>

Opens box number n (1 to 5) with the current default
colours. x1 and x2 must be in the range 0-79; y1 and y2
must be in the range 0-24.

x1 and y1 define the column and row respectively of the
top left hand corner of the box; x2 and y2 define the
column and row of the bottom right hand corner of the box.
When sizing boxes remember that the frame occupies one
character position all the way round.

<title> is an optional string which is to be used as a
title for the box. The title, if present, appears in the
top crossbar of the frame.

By default, the title is placed centrally in the crossbar.
You may however specify its position by inserting one of
the following characters at the beginning of the <title>
string:

               |   means position centrally, the default.
               +   means position towards the right-hand
                   end of the crossbar.
               -   means position towards the left-hand
                   end of the crossbar.

e.g.,

        OpenBox 1    0 0 79 24    "- Any Title "

This opens Box 1, covering the whole screen, with the
title " Any Title " positioned towards the left hand side
of the top frame cross-member.

CLOSEBOX n

Closes box number n (1 to 5).

MOVEBOX n x1 y1 x2 y2

Moves box number n to the specified new co-ordinates.

If this action shrinks the size of the box then excess
characters are truncated from the right hand side and/or
bottom of the box.

If this action causes the box to grow in size, new
character positions thus created are space-filled in
the current background colour.

TOPBOX n

Places box number n (which must be open) at the top of the
box stack.

HIDEBOX n

'Hides' box number n without closing it. The box may be
brought back into view using the TOPBOX command.

USEBOX n

Causes box number n to become the default window for
screen input/output, irrespective of whether it is
currently on top.

BOXHUES <text_fore> <text_back> <frame_fore> <frame_back>

Changes the current default colours used for opening
boxes. The default command, executed at the start of every
Scripta session, is

BOXHUES LCyan Black LRed Black

The permitted colours are

Low intensity       High intensity
~~~~~~~~~~~~~       ~~~~~~~~~~~~~~
Black               Grey
Blue                LBlue
Green               LGreen
Cyan                LCyan
Red                 LRed
Magenta             LMagenta
Brown               Yellow
LGrey               White

When a high intensity colour is used in foreground, the
text becomes more intense. When a high intensity colour is
used in background, the background colour remains at low
intensity but the foreground text flashes.

Colours omitted or set to * are left unchanged by BOXHUES.

e.g., to change the text foreground colour to Yellow:

BOXHUES Yellow

to change the frame foreground colour to LightGreen:

BOXHUES * * LGreen

Note that BOXHUES merely changes the default colours used
when opening boxes. To change the text or background
colours of the current input/output box, use the FORE and
BACK commands.

e.g., to set the current text colours to Blue on
Light Grey:

FORE Blue
BACK LGrey

The CURON and CUROFF commands may be used to switch the
cursor on and off at will. When a box is first opened, the
cursor is ON. When the currently 'top' or 'used' box is
closed, the cursor state reverts to that of the window
which becomes 'top' as a result of the closure. i.e., the
cursor state is remembered of each individual box. The
cursor POSITION is also remembered so that when you 'USE'
a different box the cursor automatically repositions to
whatever point it was at when the same window was last
'USEd' or 'on top'.

ROWCOL <row_number> <column_number>

Repositions the cursor to the specified position within
the current box. The top left hand corner of any window
is position row 1 column 1.

CURPOS

'Remembers' current cursor position, 'forgetting' any
position previously 'remembered'.

REPOS

Repositions the cursor to the last position 'remembered'
by a CURPOS command.

CLS

Fills the current box with blanks in the current
background colour and positions the cursor at row 1,
column 1. This is done automatically whenever a new box is
opened.
