Ann Arbor Ambassador User Guide

Cursor Controls

Modes that Affect the Cursor Controls

The following modes affect the terminal's response to some of the cursor controls. If the mode is not mentioned in the description of a control, the control is not affected by the mode. Detailed descriptions of these modes can be found in the Appendix.

zWFM Wrap Forward Mode (D,33). Permits the cursor to wrap forward at end of line (to beginning of next line).

zWBM Wrap Backward Mode (D,34). Permits the cursor to wrap backward at beginning of line (to end of preceding line).

zSPM Scroll-Page mode (D,36). Inhibits additional data entry at end of Page.

TSM Tabulation Stop Mode (D,18). Determines whether columnar tab stops (TSM reset) or page tab stops (TSM set) are affected by the Tab Set/Clear controls.

LNM LF New Line Mode (D,20). Selects CTRL-J (LF) as the new-line code (instead of CRLF).

zCNM CR New Line Mode (D,55). Selects CTRL-M (CR) as the new-line code (instead of CRLF).

zACM Alternate Cursor Mode (-,51). Enables the alternate cursor. The primary cursor is confined to the (working) Page and is displayed; the alternate cursor is not.

Moving the Cursor

The Ambassador provides all of the ANSI standard cursor controls.

Operator Control. The operator moves the cursor with the HOME and ARROW keys on the Control keypad. HOME moves the cursor to the first character position in the Page. UP-ARROW moves the cursor up one line. DOWN-ARROW moves it down on line. RIGHT-ARROW moves it right one column. LEFT-ARROW moves it left one column. The ARROW keys repeat when held down, regardless of the setting of zKRM (Key Repeat Mode), unless specifically re-programmed to not repeat; see Programmable Strings section.

Host Control. The host moves the cursor with the following controls. All cursor controls (except those that reference zSPM) are non-destructive, i.e. they cannot affect the contents of the Page. (Those that reference zSPM can move the contents of the Page, if zSPM is reset, losing one line from the Page. If zACM is set, they are non-destructive in all cases, i.e. the alternate cursor cannot cause the data to scroll regardless of the setting of zSPM.) Many of the controls take numeric parameters, Pn (up to a maximum value of 255). Illegal parameter values, i.e. values that would move the cursor outside the boundaries of the Page, will typically move the cursor to the applicable boundary.

CR Carriage Return (CR). Moves the cursor to beginning of the active line. If zCNM is set, it also does an implicit LF. If zCNM is set, zSPM and zACM are reset, and the cursor is in the bottom line of the Page, it does a scroll up of all data in the Page (losing the top line).

LF Line Feed (LF). Moves the cursor down one line. If LNM is set, it also does an implicit CR. If zSPM and zACM are reset and the cursor is in the bottom line of the Page, it does a scroll up of all data in the Page (losing the top line).

BS Backspace (BS). Moves the cursor left one column. If zDBM (Destructive Backspace Mode) is set, it also erases the character at that position. If zWBM is set, it is permitted to wrap to the preceding line.

CUU Cursor Up (ESC [ Pn A). Moves the cursor up Pn lines. Examples:

ESC [ A Moves the cursor up 1 line.
ESC [ 12 A Moves the cursor up 12 lines.
ESC [ 99 A Moves the cursor to top of Page (in the same column).

Note: In the last example, since the cursor cannot move 99 lines (in a maximum 60-line page), it moves to the page boundary and stops.

CUD Cursor Down (ESC [ Pn B). Moves the cursor down Pn lines.

CUF Cursor Forward (ESC [ Pn C). Moves the cursor right Pn columns. If zWFM is set, it is permitted to wrap to following lines.

CUB Cursor Backward (ESC [ Pn D). Moves the cursor left Pn columns. If zWBM is set, it is permitted to wrap to preceding lines.

HPR Horizontal Position Relative (ESC [ Pn a). Same as CUF, except limited to the active line regardless of zWFM.

VPR Vertical Position Relative (ESC [ Pn e). Same as CUD.

IND Index (ESC D). Moves the cursor down one line. If zSPM and zACM are reset and the cursor is in the bottom line of the Page, it does a scroll up of all data in the Page (losing the top line).

RI Reverse Index (ESC M). Moves the cursor up one line. If zSPM and zACM are reset and the cursor is in the top line of the Page, it does a scroll down of all data in the Page (losing the bottom line).

NEL Next Line (ESC E). Moves the cursor to the beginning of the next line. If zSPM and zACM are reset and the cursor is in the bottom line of the Page, it does a scroll up of all data in the Page (losing the top line).

CNL Cursor Next Line (ESC [ Pn E). Moves the cursor down Pn lines to beginning of line.

CPL Cursor Preceding Line (ESC [ Pn F). Moves the cursor up Pn lines to beginning of line.

HPA Horizontal Position Absolute (ESC [ Pn `). Positions the cursor to column Pn (in the same line).

VPA Vertical Position Absolute (ESC [ Pn d). Positions the cursor to line Pn (in the same column). If zACM is set, Pn is offset by the amount of any Upper Host Area setting, e.g. with a 3-line Upper Host Area, Pn = 6 (zACM reset) and Pn = 9 (zACM set) both point to line 6 in the Page.

CHA Cursor Horizontal Absolute (ESC [ Pn G). Same as HPA.

CUP Cursor Position (ESC [ Pn1 ; Pn2 H). Positions the cursor to line Pn1, column Pn2 (of the Page). If zACM is set, Pn1 is offset by the amount of any Upper Host Area setting; see VPA above. Examples:

ESC [ H Moves the cursor to line 1, column 1 (Home).
ESC [ 6 H Moves the cursor to line 6, column 1.
ESC [ ; 12 H Moves the cursor to line 1, column 12.
ESC [ 6 ; 12 H Moves the cursor to line 6, column 12.
ESC [ 99 ; 99 H Moves the cursor to end of Page.

HVP Horizontal & Vertical Position (ESC [ Pn1 ; Pn2 f). Same as CUP.

Reading the Cursor Position

The following controls may be used to read the present cursor position. The position reported is that of the primary cursor only, regardless of the setting of zACM.

DSR Device Status Report (ESC [ Pn n). This control, sent by the host with Ps = 6, requests the terminal to report its cursor position. The terminal responds in the form of a CPR control.

CPR Cursor Position Report (ESC [ Pn1 ; Pn2 R). This control is returned to the host in response to the DSR control. It reports the cursor position in the same decimal form used by the CUP and HVP controls. Examples:

ESC [ 01 ; 01 R Cursor position = line 1, column 1 (Home)
ESC [ 06 ; 12 R Cursor position = line 6, column 12

Save/Restore Cursor Position

The following controls may be used to save and restore the present cursor position (and graphic rendition setting). Either the primary or alternate cursor values may be saved. However, only one set of values may be saved at a time. The 'saved' values may be restored to either cursor.

zSC Save Cursor Position (ESC 7). Saves the cursor position (and rendition setting) in a temporary buffer for later recall. If zACM is reset, it saves the primary cursor position (and associated rendition). If zACM is set, it saves the alternate cursor position (and associated rendition).

zRC Restore Cursor Position (ESC 8). Returns the cursor position (and rendition setting) to its 'saved' values. If zACM is reset, it restores the values to the primary cursor. If zACM is set, it restores the values to the alternate cursor.

Example:

ESC [ > 51 h ESC 7 ESC [ > 51 l ESC 8
This string saves the alternate cursor position (and rendition setting) and restores it to the primary cursor. The primary cursor moves to the alternate position and subsequent entries are rendered with the alternate rendition.

Using Columnar Tabs

The Ambassador provides both columnar and full-page tab capabilities. A columnar tab stop applies to an entire column in the Page. A page tab stop applies to a single character position in the Page. Either may be used, but not at the same time. (Setting a page tab stop suspends the effect of columnar tab stops; see Using Page Tabs below.)

Columnar tabs are the more generally used, and usually at a fixed spacing (8 or 10 columns). The Ambassador initializes with an 8-column spacing, i.e. with tab stops at columns 1, 9, 17, 25, 33, 41, 49, 57, 65, and 73.

NOTE: If your facility uses a 10-column spacing, the string ESC [ 5 W CR ESC H ESC [ 10 C .... ESC H ESC [ 10 C ESC H may be used to re-initialize the settings. This string may be programmed into the Power-on string so that the terminal comes up with the 10-column settings each time it is powered on.

Operator Control. The operator sets and clears tab stops with the T-SET and T-CLR key on the Control keypad. T-SET sets a tab stop at the cursor position; T-CLR clears it. CTRL- T-CLR clears all tab stops. If TSM is reset, these keys set and clear columnar tab stops; otherwise page tab stops. (Note: In Monitor SRM, i.e. off-line entry, the operator cannot set and clear page tab stops.)

The operator tabs and backtabs with the TAB key. TAB moves the cursor right to the next tab stop; SHIFT-TAB moves the cursor left to the preceding tab stop. The TAB key repeats when held down, regardless of the setting of zKRM (Key Repeat Mode), unless specifically re-programmed to not repeat. A tab-with-justify function is available for entering right-justified data (e.g. columns of numbers; see HTJ below).

Host Control. The host sets and clears tab stops with the following controls:

HTS Horizontal Tabulation Set (ESC H). Sets a tab stop at the present cursor position. If TSM is reset, it sets a columnar tab stop, otherwise page.

TBC Tabulation Clear (ESC [ Ps g). Clears one or more tab stops according to the selective parameter, Ps. If TSM is reset, it clears columnar tab stops; otherwise page. Example:

ESC [ g Clears tab stop at the cursor
ESC [ 2 g Clears all tab stops in the line
ESC [ 3 g Clears all tab stops in the Page

CTC Cursor Tabulation Control (ESC [ Ps W). Alternative control to HTS and TBC; see Appendix.

The host tabs and backtabs with the following controls:

HT Horizontal Tabulation (HT). Moves the cursor right to the next tab stop. If zWFM is set, it is permitted to wrap to the next line. If zSPM and zACM are reset and the cursor is at the last tab stop in the Page, it does a scroll up of all data in the Page (losing the top line).

HTJ Horizontal Tab with Justify (ESC I). Same as HT except that the entry is right-justified before moving to the next tab stop. The control may be loaded into a programmable key for operator use when desired.

CHT Cursor Horizontal Tabulation (ESC [ Pn I). Moves the cursor right Pn tab stops. If zWFM is set, it is permitted to wrap to following lines.

CBT Cursor Backward Tabulation (ESC [ Pn Z). Moves the cursor left Pn tab stops. If zWBM is set, it is permitted to wrap to preceding lines.

Using Page Tabs

Page tab stops apply to single-character positions in the Page. They may be used to facilitate entry into forms (see Forms section) or display of page-like data. Note: They are typically used with zSPM in the set state (i.e. with memory scroll inhibited). A memory scroll moves the contents of the Page, but not the tab stops (by definition). Unless the tab stops are aligned in columns, an inadvertent memory scroll would move the data away from the tab stops.

Setting any page tab stops suspends the effect of columnar tab stops. Only the page tab stops are active. This is true until the Page is purposefully cleared with an RIS control, or by erasing the entire page with ERM set, or by re-defining the Page with the zSDP control. (Simply clearing the last tab stop does not re-institute columnar tabs. This permits the tab clear controls to avoid the time-consuming task of searching for remaining tab stops or DAQ qualifications.) When the page is so cleared or re-defined, the columnar tab stops become active again at their previous positions.

Page tab stops are set and cleared with the same keys and controls described above. TSM determines whether they set columnar or page tab stops. Likewise, the same tab and backtab keys and controls are used, moving the cursor according to whichever tab stops are active.