Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-11
ACCEPT Statement
•
The validated data from all screen fields referred to and present, including all
required fields, is converted and moved into the TO or USING data items in
Working-Storage associated with the screen fields.
•
Absent screen input fields do not change the associated Working-Storage data
items unless specifically requested with the WHEN ABSENT field-characteristic
clause.
•
All SHADOWED fields associated with the input fields of the ACCEPT statement
have their ENTER and RETURN bits set appropriately.
If the completion is through an ESCAPE clause, none of the TO or USING data items
is affected. Data variables retain their values, and SHADOWED ENTER and RETURN
bits are undefined.
At the end of any accept operation, the NEW-CURSOR special register is set to zero
(row 0, column 0). This controls the placement of the cursor for the next accept
operation and causes the default position to be the first field of the current ACCEPT
statement.
The ACCEPT statement indicates the condition that caused completion by storing the
condition code value into the TERMINATION-STATUS special register. Each
completion condition is assigned a code value according to its position in the UNTIL or
ESCAPE clauses. The codes are assigned by considering the conditions of the UNTIL
and ESCAPE clauses to be a single list, and assigning each condition the code value
that corresponds to its position in the list. When several conditions are grouped
together with parentheses, they are all considered to occupy the same position; that
is, all the conditions within the parentheses receive the same code value, and the next
condition 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










