1Eh ED$VIEW display a multiline text
Input
X register -  0 to continue viewing where it left off last time called;
non-zero for 1st view or to start again.
UTW_S0 -  Initial delay before scrolling (in 1/20 second units).
Output - none -
Description

Allows the user to view the string that is in the run-time buffer RTT_BF with length RTB_BL. Called by the OPL VIEW function.

New lines are specified by TABs, and the up and down arrow keys control the line being scrolled. Two spaces are displayed between the end and beginning of any scrolling text. The left and right arrow keys are used to stop, start and change direction of scrolling. Any other key pressed is returned in the B register.

When called with a new string in RTT_BF (or when the display has been used since the last call), the X register must be non-zero to view from the beginning of the text. After exiting from this routine, the programmer can cause the display to continue at the same place as it last stopped, by calling it again with the X register set to 0.

Calling initially with the X register equal to 0 produces unpredictable results.

UTW_S0 specifies the delay (in 1/20 second units) before a line starts scrolling.

The cursor is switched off during this routine but the cursor state prior to the call is maintained. Corrupts location DPB_CPOS the current cursor position.

Example View the 3 lines in VIEW_BUFFER until the EXE key is pressed.
VIEW_BUFFER:
        DB      "(Some interesting data)"
        DB      9                               ; TAB for new-line
        DB      "(End of data)"
        DB      9
        DB      "Press EXECUTE to continue"
END_BUFFER:

DO_VIEW:
        LDD     #END_BUFFER-VIEW_BUFFER
        STD     UTW_S0:          ; Length of buffer to be copied
        STAB    RTB_BL           ; Set up run time buffer's length
        LDX     #VIEW_BUFFER     ; Source buffer
        LDD     #RTT_BF          ; Destination buffer
        PSHX                     ; Save non-zero X
        OS      UT$CPYB          ; Copy VIEW_BUFFER to RTT_BF
        PULX                     ; Restore non-zero X for 1st view
LOOP:
        LDD     #40
        STD     UTW_S0:          ; Wait 2 seconds before scrolling
        OS      ED$VIEW
        LDX     #0               ; X=0 for subsequent views
        CMPB    #13              ; EXE key pressed?
        BNE     LOOP             ; No, so loop
        RTS
Errors - none -