Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
6-11
ACCEPT Statement
following the group receives the code value that is one greater than that assigned to the
conditions in the group.
In the following example, the value of TERMINATION-STATUS is 1 if the Enter key
is pressed, 2 for the CLEAR key, 2 for the PA1 key, and 3 for the PF1 key.
ACCEPT CUSTOMER-SCREEN UNTIL ENTER
ESCAPE ON (CLEAR, PA1), PF1
In the next example, the value of TERMINATION-STATUS is 1 if F1 is pressed, 2 if
Shift-F16 is entered, 3 if there is a timeout, and 4 if an unsolicited message is received.
GET-OPER-INPUT.
ACCEPT my-screen
UNTIL f1-key
sf16-key
ESCAPE ON
TIMEOUT 300
UNSOLICITED MESSAGE.
PERFORM ONE OF f1-key-action
sf16-key-action
timed-out
unsol-msg-arrival
DEPENDING ON TERMINATION-STATUS.
GO TO get-oper-input.
Conversational Mode Accept Operation
The ACCEPT statement displays the prompt value for the first screen field described
with a PROMPT clause, enables the keyboard, and waits for data to be entered from the
terminal. (If no screen field description contains a PROMPT clause, the ACCEPT
statement begins at the first column of the screen.) If termination is caused by a
completion condition specified in the ESCAPE clause, the ACCEPT statement
terminates at this point with no changes to the Working-Storage data items. The
ACCEPT statement always displays the prompt value in the first column of the screen
line and positions the cursor at the end of the prompt field regardless of the positions
specified for the field in the screen description.
When the terminal is enabled for input, data can be accepted for each input field a line at
a time or accepted for more than one field on the same line. If the typeahead capability
is used, field or group separators delimit the screen fields such that multiple fields of
data are accepted in a single buffer. When typeahead is used, only the prompt value for
the first field is displayed. Then, no other prompts appear until the end of the input is
indicated by either a carriage return or an input-control character.
The ACCEPT statement processes input data in the order the data is received from the
terminal. The input data is associated with the screen fields in the sequence the fields
are defined in the Screen Section. The data is accepted until there is no more input, the
abort-input character is entered, or an error is detected. The sequence in which the
screen identifiers are processed is from top to bottom and from left to right as follows:
1. The screen field with a lower row (line) number is processed before a screen field
with a higher row number.