ACCEPT statement

The ACCEPT statement causes data to be made available to the specified data item.

The execution of an ACCEPT screen statement causes the following sequence of events:

Format 1.

          ACCEPT identifier-1 [ FROM mnemonic-name-1 ] [ END-ACCEPT ]

Format 2.

                                   { DATE [ YYYYMMDD ] }
                                   { DAY [ YYYYDDD ]   }
                                   { TIME              }
                                   { DAY-OF-WEEK       }
          ACCEPT identifier-2 FROM { COMMAND-LINE      } [ END-ACCEPT ]
                                   { ARGUMENT-NUMBER   }
                                   { ARGUMENT-VALUE    }
                                   { ENVIRONMENT-NAME  }
                                   { ENVIRONMENT-VALUE }
                                   { mnemonic-name-2   }

Format 3.

          ACCEPT screen-name-1

                         { LINE [ NUMBER ] { identifier-3 }         }
                         {                 { integer-3    }         }
                [ [ AT ] {                                          }
                         { { COLUMN   } [ NUMBER ] { identifier-4 } }
                         { { COL      }            { integer - 4  } }
                         { { POSITION }                             }

                [ [ ON ] EXCEPTION imperative-statement-1 ]
                [ NOT [ ON ] EXCEPTION imperative-statement-2 ]

                [ END-ACCEPT ]

Format 4.

          ACCEPT identifier-5

                         { LINE [ NUMBER ] { identifier-3 }         }
                         {                 { integer-3    }         }
                [ [ AT ] {                                          }
                         { { COLUMN   } [ NUMBER ] { identifier-4 } }
                         { { COL      }            { integer - 4  } }
                         { { POSITION }                             }

                [ FROM CRT ]

                       { BLANK { SCREEN }                              }
                               { LINE   }
                       { FULL                                          }
                       { { AUTO }                                      }
                         { AUTO-SKIP }
                       { { SECURE }                                    }
                         { OFF }
                       { REQUIRED                                      }
                       { { BELL }                                      }
                         { BEEP }
                       { BLINK                                         }
                       { { HIGHLIGHT }                                 }
                         { HIGH }
                [ WITH { { LOWLIGHT }                                  } ... ]
                         { LOW }
                       { REVERSE-VIDEO                                 }
                       { UNDERLINE                                     }
                               { [ END OF ] SCREEN }
                       { ERASE { [ END OF ] LINE   }                   }
                               { EOS               }
                               { EOL               }
                       { { FOREGROUND-COLOR  } [ IS ] { identifier-2 } }
                         { FOREGROUND-COLOUR }         { integer-2   }
                       { { BACKGROUND-COLOR  } [ IS ] { identifier-3 } }
                         { BACKGROUND-COLOUR }         { integer-3   }
                       { PROMPT [ CHARACTER IS ] { identifier-4 }      }
                                                 { literal-4    }

                [ [ ON ] EXCEPTION imperative-statement-1 ]
                [ NOT [ ON ] EXCEPTION imperative-statement-2 ]

                [ END-ACCEPT ]

Notes.

mnemonic-name-2 must be associated in the SPECIAL-NAMES with either COMMAND-LINE, ARGUMENT-NUMBER, ARGUMENT-VALUE, ENVIRONMENT-NAME or ENVIRONMENT-VALUE.

COMMAND-LINE will return the command line.

ARGUMENT-NUMBER will return the current argument number. The argument number is initialy set to 0. It can be explicitly set using a DISPLAY statement.

ARGUMENT-VALUE returns the value of the current argument, as specified by ARGUMENT-NUMBER. If a second ACCEPT FROM ARGUMENT-VALUE is issued without an intervening DISPLAY UPON ARGUMENT-NUMBER, then the current argument number is increased before the second ACCEPT is executed.

ENVIRONMENT-NAME returns the current environment name. The environment name is initialy cleared. It can be set using a DISPLAY statement.

ENVIRONMENT-VALUE returns the value from the current environment name as indicated by ENVIRONMENT-NAME.

A format 3 or format 4 ACCEPT will accept a formatted screen. The user can move from field to field by using the up-arrow and down-arrow, or tab and back-tab.

Whenever the first keystroke entered in a field is a printable character, then the remainder of the field is cleared. The left-arrow, right-arrow, back-space and delete keys work as expected. The insert key toggles between insert-mode and overwrite-mode.

Numeric fields can be entered in free format, and will be normalized upon leaving the field.

In alphanumeric-edited fields, the insert, delete and backspace keys are disabled, and fixed insertion characters can not be modified. The enter key, and the function keys can be used to terminate data-entry.

if the CRT-STATUS data-item is declared in the SPECIAL-NAMES paragraph, then it shall be a 4-byte field. The first byte returns '0' when data-entry is terminated with the enter key. It contains a '1' if data-entry is terminated with a function key; the remaining three bytes contain the function key number.