INPUT

INPUT statement is used to perform data entry into form fields.

INPUT binding clause

The clause that associates the variables with the input fields, It is the only obligatory clause

ATTRIBUTE clause

An optional ATTRIBUTE clause where the attributes for the fields used for input can be specified

HELP clause

An optional HELP clause where the help number for the input can be specified

INPUT control block

An optional block which controls the process of input

 

The INPUT statement assigns the values entered into form fields to the corresponding program variables. This statement may include clauses that specify the actions which 4GL should perform before or after input, clauses that are executed only under certain conditions (such as cursor movement or when some actions are performed by the user), etc.

 

To use the INPUT statement, please follow these steps:

  1. Create a form file and specify one or more text fields in this file, compile the form file.

  2. Declare program variables by means of the DEFINE statement

  3. Open the form either with the help of the OPEN FORM and DISPLAY FORM statements or with the help of the OPEN WINDOW … WITH FORM statement.

  4. Use the INPUT statement to assign values entered into the form fields to the variables.

 

When the INPUT statement is encountered, it triggers these actions:

  1. The default values are displayed to the form fields. The values are not displayed if:

    • there are no default values assigned to these fields (you may assign default value to a field using the form specification file)
    • you use the INPUT statement with the WITHOUT DEFAULTS
  2. The cursor is moved to the first field (the order of fields is specified by the INPUT statement either explicitly or implicitly).
  3. The user is allowed to perform input either in any order or in the order specified in the INPUT control clause.
  4. The value entered by the user is assigned to the corresponding variable when the cursor leaves the field, or if the Accept key is pressed.

 

When 4GL encounters the INPUT statement, the most recently displayed form or the form in the current window is activated. It is deactivated when the input is complete.

 

The INPUT statement must always have the Binding clause, where the form fields are associated with the program variables; it can also have such optional clauses:

The INPUT statement can include the CONTINUE INPUT and EXIT INPUT statements. If the INPUT statement contains at least one INPUT control clause, the end of the INPUT statement must be indicated with the help of the END INPUT keywords.

 

If you use the INPUT statement independently, you can omit END INPUT keywords.

If you use INPUT within any dialog block, END INPUT keywords are required.

 

When you call INPUT, INPUT ARRAY, or DISPLAY ARRAY statements from another INPUT, you must explicitly specify the end of the embedded statement (by END INPUT or END DISPLAY). Otherwise, you will get the compilation error because the compiler will not understand the order of statements and their clauses.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.