

Description:
This built-in enables/disables window scrolling and sets scroll margins.
Scrolling moves text in a window up and down line by line, leaving the cursor in
its same position but with its line number changing. When cursoring up and down,
the whole screen scrolls, not just the cursor.
To set the scrolling in a window, the window must be identified in the second
parameter, and it must be set to ON or OFF in the third parameter. ON is the
default for terminals that support scrolling, and OFF is the default for
terminals that do not support it. When set to OFF, a screen repaints itself each time
a scroll would have occurred.
The first integer is the offset limit for the top of the window, which the
cursor cannot go beyond when tracking the editing position. Once it reaches that
line, the text will start to move down line by line to keep the cursor within
this top scroll margin. The second integer is the offset limit for the bottom of
the window, which the cursor can't go beyond when tracking the editing
position. Once it reaches that line, the text will move up line by line to keep the
cursor within this bottom scroll margin. If the cursor gets to the buffer top or
bottom, scrolling ends. The third integer is the number of lines from which the
cursor should be positioned from the scroll margins after scrolling. If set to
0, the cursor will be positioned on the scroll margin.
Keep in mind the limits of these integers. They must all be greater than or
equal to 0 and less than or equal to the number of lines in a window. The sum of
the third integer and either the first or second integer must be less than the
total number of lines in the window, as must the sum of the first and second
integers.
If the top or bottom line of a window is already visible when moving backward
or forward respectively, the scroll margins will be ignored, as they will when
using CURSOR_VERTICAL with CROSS_WINDOW_ BOUNDS set to off. When shrinking a
window with ADJUST_WINDOW, the scroll margins will be proportionally reduced,
although this does not work conversely when enlarging a window.
Syntax:
SET(SCROLLING, window, {ON | OFF}, integer, integer, integer)
Example:
The following statement turns scrolling on for the current window. It also
defines the top and bottom scroll margins as 0, which means the cursor may move to
the first and last lines of the window without scrolling the text.
SET(SCROLLING, ON, 0, 0, 0);
Errors:
TPU$_BADKEY Invalid keyword.
TPU$_BADMARGINS Invalid margin value.
TPU$_BADVALUE Value is beyond the acceptable range.
TPU$_UNKKEYWORD Keyword not recognized.
Related Builtins:
SET(SCROLLING)