Certain terms are used in describing the Ambassador's Form-Filling features. They are defined below to clarify their usage. These definitions follow, and are consistent with, the ANSI definitions.
The terminal is said to be in Forms Mode when any Area Qualifier has been set within the page.
NOTE: The significance of Forms Mode is that the user, by setting a control attribute at a specified character position within the Page, conceives of the Page as a page, rather than as a scrolling window into the host.
A portion of the Page bounded by tab stops. A Field contains the character position at the beginning tab stop and excludes the character position at the trailing tab stop. In Forms Mode, the tab stops are page tab stops; see Cursor Controls, Using Page Tabs. Page tab stops are also Area Qualifiers. A Field contains at least one, and possibly more, Qualified Areas (e.g. an unprotected and a protected Area).
NOTE: This differs from the common definition of 'field' (as a protected, followed by unprotected, region). We have adhered to the ANSI definition.
The following modes affect form-filling. Their settings can be reviewed, and changed as desired, on the Setup lines; see Setup section. The Setup line letter, and mode number, are shown in parentheses following the name. Detailed descriptions of these modes can be found in the Appendix.
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.
ERM Erasure Mode (D,6). Permits the erasure of characters regardless of their protected status.
zAKDM Auto Keyboard Disable Mode (B,46). Upon completion of a transmission, the keyboard is automatically re-enabled (and the cursor symbol returns). This mode permits the keyboard to remain disabled, until purposefully released by the host with an EMI control.
zHAM Hold in Area Mode (A,48). In normal entry, when an Area is filled, the cursor auto-skips to the next Area. This mode permits the cursor to remain in the Area, until purposefully advanced with the TAB key.
Forms are created with the DAQ control.
DAQ Define Area Qualification (ESC [ > Ps..Ps o
). Sets an Area Qualifier
at the present cursor position, assigning one or more control attributes
to the position according to the selective parameters:
Page Tab Stop (Ps = 7). Sets a page tab stop at the beginning of the Area. The tab stop is active in respect to entries from the host, as well as Local Entry.
Protected/Guarded (Ps = 1). Local Entry is not permitted into the Area, and the contents of the Area will not be included in transmissions to the host (if GATM is reset) or in transfers to the printer (if zGAPM is reset).
Protected/Unguarded (Ps = 8). Local Entry is not permitted into the Area, but the contents of the Area are included in transmissions to the host and transfers to the printer, regardless of the settings of GATM and zGAPM.
Unprotected (Ps = 0). Local Entry is permitted into the Area.
Numeric Only (Ps = 3). Local Entry is permitted into the Area, but restricted to numerics and punctuation only (codes 2/0 (Sp) to 3/15 (?) inclusive).
Right Justify (Ps = 5). Local Entry is permitted into the Area, but is right justified when leaving the Area with the TAB key (i.e. the entry is shifted right until a non-Space character occupies the last character position in the Area).
Concealed (Ps = 18). Local Entry is permitted into the Area, but is displayed only as 'white' Spaces.
Note that the attributes that restrict entry apply only to operator entries in an off-line (i.e. Monitor SRM) situation. In that situation, the entry control functions must be accomplished in the terminal (because the host is not involved in the entry). In an on-line (i.e. Simultaneous SRM) situation, the entry control functions are better accomplished in the host Software.
The DAQ control is not the only control that can create a Form (and put the terminal into Forms Mode). The following controls are not as versatile as DAQ, but are more code efficient and may achieve the same effect in special situations:
SPA Start of Protected Area (ESC V
). Same as DAQ control, ESC [ 1 o
.
EPA End of Protected Area (ESC W
). Same as DAQ control, ESC [ 7 o
.
HTS Horizontal Tab Set (ESC H
). Same as DAQ control, ESC [ 7 o
(if TSM is set).
This example sets up a one-line Form. A diagram of the Form is shown, followed by the string that creates it. This example will be used later to illustrate the entry of data into the Form, and the sending and printing of the entered data.
In the diagram of the Form (following), the numbers are column numbers across the line. The entry 'FORM#1' is in a Protected/Unguarded area. The operator cannot change it, but it will be included in transmissions to the host. The other entries in upper-case are in Protected/Guarded areas. They are likewise protected from the operator, but will not normally be included in transmissions to the host. The lower-case letters show the Unprotected areas, a lower-case 'a' indicating alphanumeric, and lower-case 'n' indicating Numeric-only. The unprotected area following WAGE is a Right-Justify area. The unprotected area following CODE is a Concealed area. The unprotected area following NOTES extends to end of Page. All protected areas will be displayed with a Reverse rendition. The symbol 'T' indicates the location of page tab stops.
The string that creates the Form is broken into multiple lines for clarity and ease of annotation (i.e. new-line codes should not be included in the string). The spaces shown between characters are also for clarity (and should not be included, except as specifically called for with the designation, Sp). ESC denotes the ESC-code (1/11).
Form:
1 2 3 4 5 6 12345678901234567890123456789012345678901234567890123456789012345678 FORM#1 NAME aaaaaaaaaaaaa AGE nn WAGE nnnn.nn CODE aaaaaa NOTES aaa... T T T T T
String:
ESC [ 7 m |
Sets the GR-register to Reverse rendition |
ESC [ H |
Moves the cursor Home |
ESC [ 8 o |
Starts a protected/unguarded Area |
FORM#1 |
Writes 'FORM#1' into the Area |
ESC [ 1 o |
Starts a protected/guarded Area |
SpNAMESSp |
Writes ' NAME ' into the Area |
ESC [ 7 o |
Sets a page tab stop and starts an unprotected Area |
ESC [ 26 ` |
Moves the cursor to column 26 |
ESC [ 1 o |
Starts a protected/guarded Area |
SpAGESSp |
Writes ' AGE ' into the Area |
ESC [ 7 ; 3 o |
Sets a page tab stop and starts a Numeric-only Area |
ESC [ 33 ` |
Moves the cursor to column 33 |
ESC [ 1 o |
Starts a protected/guarded Area |
SpWAGESp |
Writes ' WAGE ' into the Area |
ESC [ 7 ; 3 ; 5 o |
Sets a page tab stop, starts a Numeric/Justify Area |
ESC [ 46 ` |
Moves the cursor to column 46 |
ESC [ 1 o |
Starts a protected/guarded area |
SpCODESSp |
Writes ' CODE ' into the Area |
ESC [ 7 ; 18 o |
Sets a page tab stop and starts a Concealed Area |
ESC [ 58 ` |
Moves the cursor to column 58 |
ESC [ 1 o |
Starts a protected/guarded Area |
SpNOTESSp |
Writes ' NOTES ' into the Area |
ESC [ 7 o |
Sets a page tab stop and starts an unprotected Area |
The control attributes (i.e. Area Qualifiers) are not stored in the Page (with the characters and their visual attributes) but are, instead, stored separately, as a control table, indexed by character position. This not only permits the Form to be rapidly written when needed, it is also efficient when entering data into the Form, and when sending or printing data from it.
It has the added advantage of clearly separating the visual and control attributes. The person creating the Form may freely associate these attributes in any way that best accomplishes the task at hand (including no association, or different associations in different parts of the Form). The rendition of protected parts of the Form is controlled when the Form is written. The rendition of the unprotected parts of the Form is controlled by the setting of the GR-register when the unprotected areas are erased. The rendition of the operator's entries is controlled by the setting of the GR-register during the entry.
Thus, a 'Form' exists in the terminal only by virtue of a table of Area Qualifiers vs. character position. The significance of Forms Mode, is that it causes the Display Processor to reference the table as part of processing an input. If the input is a local keyboard entry (i.e. from the keystroke buffer; see Entering Data into the Form), the Display Processor references the table for each entry. If the input is received from the host (i.e. from the FIFO buffer), the Display Processor references the table only when it receives one of the tab controls (HT, CHT, CBT, or HTJ).
The Area Qualifier (AQ) table contains up to 320 Area Qualifiers. This is the only factor that limits the complexity of the Form that can be created; there are no limits on number of qualifiers per line, spacing between qualifiers, etc.
The AQ table may be edited in various ways:
An entry may be changed by first positioning the cursor to the Area Qualifier (i.e. to the first character position of the Area).
A DAQ control may be used to change the Area Qualifier in accordance with new parameters. (This is likewise true of the SPA and EPA controls.)
A set-tab control, HTS (ESC H
) or CTC (ESC [ W
), may be used to add a tab stop
to the Area Qualifier. A clear-tab control, TBC (ESC [ g
) or CTC (ESC [ 2 W
),
may be used to remove a tab stop from the Area Qualifier. A clear-all-tabs-in-line
control, TBC (ESC [ 2 g
) or CTC (ESC [ 4 W
), may be used to remove tab
stops from all Area Qualifiers in the Active line. A clear-all-tabs control,
TBC (ESC [ 3 g
) or CTC (ESC [ 5 W
), may be used to remove tab stops from all
Area Qualifiers. In all cases, the tab stops are added or removed without
changing any of the other control attributes of the Area Qualifier.
Whenever a tab stop is removed, the remaining attributes of the Area Qualifier are compared with the attributes of the preceding Area Qualifier. If they are the same (or the same except for a tab stop in the preceding qualifier), the entry is deleted (i.e. the preceding Area is extended to encompass the present Area).
An entry may be inserted into (or added to) the table, by first positioning the cursor to the desired position (that does not presently contain an Area Qualifier, i.e. any position other than the first character position of an existing Area).
A DAQ control inserts an Area Qualifier with the attributes specified by its
parameters. An SPA control inserts an Area Qualifier with a 'protected' attribute
only. An EPA control inserts an Area Qualifier with 'unprotected' and
tab stop attributes. An HTS (ESC H
) or CTC (ESC [ W
) control inserts an Area
Qualifier having the same attributes as the preceding Area Qualifier, with a
tab stop attribute added.
When an entry is inserted into the table, no comparison is made with adjacent entries. Adjacent Areas with identical attributes may be written (or inserted), if desired.
Entries may be deleted from the table by erasing the region containing the entries, with ERM (Erasure Mode) set.
An ECH (ESC [ X
) control deletes the Area Qualifier at the cursor position, if
any. An EA (ESC [ 2 O
) control deletes the Area Qualifier associated with the
Active Area. An EF (ESC [ 2 N
) control deletes all Area Qualifiers in the Active
Field. An EL (ESC [ 2 K
) control deletes all Area Qualifiers in the Active
Line. An ED (ESC [ 2 J
) control deletes all Area Qualifiers.
An entry may also become deleted by virtue of removing a tab stop; see Changing an Entry in the AQ Table, above.
Simply deleting the last Area Qualifier in the Page does not remove a Form (i.e. reset Forms Mode). One of the following explicit controls is required to remove the Form.
A full-Page erase (ESC [ 2 J
or ESC [ H ESC [ J
) with ERM set, or an RIS (ESC
c
) control, removes the Form and erases the Page.
A zSDP (ESC [ Pn..Pn p
) control removes the Form without erasing the Page.
The host writes the Form to the terminal by sending the necessary string; see Example Form, above. This may be done in either Simultaneous or Monitor SRM. (The host retains full control of the terminal, including the ability to write to the display, in Monitor SRM.) If done in Monitor SRM, the keyboard should first be disabled (so that inadvertent operator entries are not interspersed), and re-enabled only after the form has been written, and the terminal initialized for operator entry.
The following is a typical string for initializing the Form in Simultaneous SRM:
Form string | Writes the Form |
ESC [ m |
Sets GR-register to Normal rendition |
ESC [ 2 J |
Erases all unprotected Areas |
ESC [ > 36 h |
Sets Page mode (to inhibit memory scroll) |
ESC [ 12 l |
Puts the terminal into Monitor SRM |
Note: The Form initialization string will typically include other controls to tailor the operator's keyboard (and the various modes) to the application. These are discussed in the appropriate sections below.
The terminal is now in Monitor SRM, and the operator may locally enter data to the Form. The terminal's FIFO is not being used by the operator. It may be used by the host to write into the Host Areas or Inactive Memory with the Alternate cursor; see Display section. This is totally parallel operation and does not interfere, in any way, with the operator's entry, (e.g. the host could maintain a real-time clock in the Host Area, without interrupting or slowing down the operator.) The host may also write into the operator's Page, if desired, but should use the DMI/EMI controls to disable/enable the operator's keyboard to avoid any possibility of conflict. The host may also use the terminal's FIFO to print (while the operator is entering data) using the zSRC (Remote Copy) control; see Printer section.
NOTE: The Form itself may be written with the Alternate cursor (e.g. to set page tab stops in the Host Areas and Inactive Memory for the host's use). Keep in mind, however, that the line numbers referenced by the Alternate cursor differ from those referenced by the Primary cursor, if an Upper Host Area is used; see Display section, Using the Alternate Cursor.
The operator's input is processed one keystroke at a time; escape and control sequences are not assembled. Thus the operator cannot type in undesired sequences. (For example, if the operator types the ESC key, an ESC-code is processed, which does nothing. If the operator follows it with a graphic character, the character is processed and written to the screen.) The system programmer can provide the operator with any sequences of controls that are desired for application, by loading them into Programmable keys as part of the Form initialization string.
Similarly, if there are terminal control keys that the system programmer wishes to deny to the operator (such as RESET, SETUP, BREAK, etc.), these keys may be disabled by loading them with null in the Form initialization string. Example:
ESC P ` & | | | ESC \
Disables the RESET, SETUP, and BREAK keys.
The operation of the terminal control keys, if not re-programmed, is described in the Keyboard section. The keys operate the same in Forms Mode, with the following exceptions:
Local cursor controls are restricted to unprotected areas. If the cursor is moved into a protected area, it will auto-skip right to the first unprotected character position.
Local tab set/clear controls are ignored.
Local erase controls (EA, EF, EL) are constrained to erase only in the Active Area, regardless of the control used. A Local ED control is constrained to erase only unprotected areas, regardless of the setting of ERM.
Local edit controls are constrained to edit only in the Active area, regardless of the setting of SEE.
These exceptions apply to all terminal controls entered from the keyboard during Local Entry, regardless of whether they are the original or re-programmed strings, and regardless of what keys generate them.
The operator will typically use the TAB key to move about the Form. If the Form contains tab stops at the beginning of unprotected Areas, TAB moves the cursor right to the beginning of the next unprotected Area. SHIFT-TAB moves the cursor left to the beginning of the preceding unprotected Area (if the cursor is at the beginning of the Active Area) or to the beginning of the Active Area (otherwise). Attempting to tab past the last unprotected Area (or backtab past the first unprotected Area) results in an error 'beep'.
During operator entry, zHAM (Hold in Area Mode) controls what happens when the operator writes into the last character position of an Area. If zHAM is reset, the cursor auto-skips to the beginning of the next unprotected Area. If zHAM is set, the cursor remains at that position until the TAB key is used to leave the Area.
If the operator attempts to write an alpha character into a Numeric-only area (such as AGE and WAGE in the Example Form), an error 'beep' results. When the operator terminate entry into a Right-Justify area (such as WAGE in the Example Form), with the TAB key, the entry moves right to the end of the Area. When the operator writes into a Concealed area (such as CODE in the Example Form), the characters are not displayed (but 'white' Spaces are displayed instead, as markers).
The operator may correct an error before leaving an Area, or backtab to the Area to correct it. An entry (or part of it) may be erased with the Spacebar, with BACKSPACE (if zDBM is set), or with the ERASE key. An entry may be edited with the EDIT, INSERT, and DELETE keys. In all cases, only the Active Area is affected.
When the entered data are ready to transmit, the operator depresses the SEND
key. This disables the keyboard, and sends the data to the host. The keyboard
is automatically re-enabled upon completion of the transmission, unless
zAKDM (Auto Keyboard Disable Mode) is set, whereupon it remains disabled until
purposefully re-enabled by the host (e.g. with the EMI control, ESC b
). This
permits the host to 'protect' the displayed data (from operator actions) until
it has performed whatever validity checks are desired.
The operation of the Send controls and modes is described in the Send Controls section. Their operation is the same in Forms Mode. Examples:
The format of the Example Form was:
FORM#1 NAME aaaaaaaaaaaaa AGE nn WAGE nnnn.nn CODE aaaaaa NOTES aaa...
Assume that it was filled out by the operator as shown below, the symbol '-' being used to represent an unprotected Space. (Note: The characters shown in the Area following CODE are the characters entered, not displayed. The characters, A789, are displayed as 'white' spaces; the two characters that follow them are displayed as 'black' spaces.)
FORM#1 NAME John Doe----- AGE 37 WAGE --12.34 CODE A789-- NOTES None
In the examples below, spaces are shown between the transmitted characters for clarity; they are not part of the transmission. The symbol '-' is used to show the transmission of a Space (2/0) from an unguarded character position. The symbol '+' is used to show the transmission of a Space (2/0) from a guarded position.
With the Transfer modes, FETM, GATM, zFSTM, and zGRTM reset, the content of the transmission is shown below. NL indicates a new-line code, as selected by LNM: CR LF (if LNM is reset) or LF (if LNM is set). An NL is included in the transmission at the end of every line (including partial lines) in the transmitted region, regardless of whether the line contains data, is guarded, etc. The present example assumes that TTM is reset (i.e. transmit to cursor) and that the cursor is in the top line (following the data).
F O R M # 1 J o h n - D o e - - - - - 3 7 - - 1 2 . 3 4 A 7 8 9 - - N o n e NL
Setting FETM causes the new-line codes to be not included in the transmission:
F O R M # 1 J o h n - D o e - - - - - 3 7 - - 1 2 . 3 4 A 7 8 9 - - N o n e
Setting GATM causes all Areas (including those designated as Guarded) to be included in the transmission:
F O R M # 1 + N A M E + J o h n - D o e - - - - - + AGE + 3 7 + W A G E + - - 1 2 . 3 4 + C O D E + A 7 8 9 - - + N O T E S + N o n e NL
Setting zFSTM causes trailing Spaces to be suppressed (and HT codes inserted to mark their omission) in the transmission:
F O R M # 1 HT J o h n - D o e HT 3 7 HT - - 1 2 . 3 4 HT A 7 8 9 HT NL
Setting zGRTM causes Graphic Rendition information (in the form of SGR controls) to be included in the transmission: (Note: In this example, GATM is also set, so as to illustrate multiple rendition changes. It also illustrates how a Form could be created and edited by the operator on the screen, the host software translating the SGR controls into the appropriate DAQ controls in a prescribed manner.)
ESC [ 7 m F O R M # 1 + N A M E + ESC [ m J o h n - D o e - - - - - ESC [ 7 m + A G E + ESC [ m 3 7 ESC [ 7 m + W A G E + ESC [ m - - 1 2 . 3 4 ESC [ 7 m + C O D E + ESC [ m A 7 8 9 - - ESC [ 7 m + N O T E S + ESC [ m N o n e NL
The preceding examples assumed that no Header/Trailer strings were programmed. If they had been, the Header string would have preceded the transmission shown, and the Trailer string would have followed it. These strings may be used to bracket the transmissions with control codes or data needed, or desired, by the host.
If the host does validity checking of the transmitted data, zAKDM should be set (to 'protect' the displayed data from inadvertent operator actions until the validity checks are completed).
If there was an error in the entry of the data, the host, if desired, may use the zGUA control, so that after correction, only the corrected data are included in the re-transmission.
zGUA Guard Unprotected Areas (ESC :
). Causes all unprotected Areas in
the Page to become guarded. Thereafter, any operator entry into an Area
causes that Area to become unguarded.
Example: In the zFSTM example above, the transmission was:
F O R M # 1 HT J o h n - D o e HT 3 7 HT - - 1 2 . 3 4 HT A 7 8 9 HT NL
Suppose that the actual transmission contained 97, in the AGE Area (instead of 37), and that the host finds that to be an invalid entry:
F O R M # 1 HT J o h n - D o e HT 9 7 HT - - 1 2 . 3 4 HT A 7 8 9 HT NL
The host must inform the operator that there is an error, and where. This may be done via the Host Area; however, it may also be done with the following string:
ESC [ 5 m |
Sets the GR-register to Blinking |
HT |
Moves the cursor to the next tab stop (the error Area) |
ESC 9 |
Causes the 97 to blink |
ESC [ m |
Restores the GR-register to Normal |
ESC : |
Guards all unprotected Areas |
ESC b |
Re-enables the keyboard |
The operator now sees a blinking Area on the screen and knows (by pre-arrangement) to correct it. As the operator overwrites the entry, it stops blinking (because the GR-register was restored to Normal). When the operator depresses the SEND key, the resulting transmission will contain:
F O R M # 1 HT HT 3 7 HT HT HT NL
If the host accepts the corrected entry as valid, it may re-initialize the Form (for the next set of entries) as follows:
ESC [ 6 l |
Resets ERM (erase unprotected) |
ESC [ 2 J |
Erases the Page |
ESC b |
Re-enables the keyboard |
Erasing the Page indicates to the operator (by pre-arrangement) that the host is ready for a new set of entries. It also restores any guarded unprotected Areas to unguarded.
In the last string, the Reset ERM control may be omitted if the host resets ERM in the Form initialization string, and leaves it reset.
In the preceding string, if the host had used the Alternate cursor to send the string, there would have been no need to set and restore the GR-register. The Alternate cursor has its own GR-register, which could have been preset to Blinking in the Form initialization string. (That would result in erasing the screen to blinking Spaces, but that is not discernable to the operator, nor to the host (unless zGRTM is used).
The operation of the Print controls and modes is described in the Printer section. Their operation is the same in Forms mode.
In a data entry situation, printing will normally be done by the host, using Remote Copy, during the periods while the operator is entering data; see Initializing the Form, above.
The Form may also be used, with Page Print, simply to obtain a formatted printout. Using the example entry again (the symbol '-' still being used to represent an unprotected Space):
FORM#1 NAME John Doe----- AGE 37 WAGE -- 12.34 CODE A789-- NOTES None
In the examples below, spaces are shown between the transferred characters for clarity; they are not part of the transfer. The symbol '-' is used to show the transfer of a Space (2/0) from an unguarded character position. The symbol '+' is used to show the transfer of a Space (2/0) from a guarded position.
With zGAPM reset, the characters in guarded Areas are transferred as Spaces. The transfer to the printer is illustrated below. NL indicates a new-line code, as selected by the setting in Setup line C: CR, LF, or CR LF. An NL is included in the transfer at the end of every line (including partial lines) in the transferred region, regardless of whether the line contains data, is guarded, etc. The present example assumes that TTM is reset (i.e. transfer to cursor) and that the cursor is in the top line (following the data).
F O R M # 1 + + + + + + J o h n - D o e - - - - - + + + + + 3 7 + + + + + + - - 1 2 . 3 4 + + + + + + A 7 8 9 - - + + + + + + + N o n e NL
With zGAPM set, all characters are transferred, regardless of their guarded status. The transfer to the printer is illustrated below.
F O R M # 1 + N A M E + J o h n - D o e - - - - - + A G E + 3 7 + W A G E + - - 1 2 . 3 4 + C O D E + A 7 8 9 - - + N O T E S + N o n e NL
Given a Form, e.g. a Telephone Contact report with protected heading like Name, Company, Subject, Action Required, etc., the data would probably be printed with zGAPM set (so that both the data and the headings are printed). However, if the Form (in the terminal) matched a pre-printed Form (on the printer), e.g. an Invoice form, the data would probably be printed with zGAPM reset (so that only the data are printed). The headings on the terminal's Form would be transferred as Spaces, merely spacing over the pre-printed headings on the printer's Form.