CLEAR field-list

The CLEAR field-list instruction clears specific fields in the current form.

Syntax

CLEAR field-list
where field-list is:
{ field-name
| table-name.*
| table-name.field-name
| screen-array[line].*
| screen-array[line].field-name
| screen-record.*
| screen-record.field-name
}
[,...]
  1. field-name is the identifier of a field of the current form.
  2. table-name is the identifier of a database table of the current form.
  3. screen-record is the identifier of a screen record of the current form.
  4. screen-array is the screen array that will be used in the form.

Usage

The CLEAR field-list instruction can be used to clear the content of the specified form fields.

The fields to be cleared can be specified individually or by referencing a screen record or screen array, eventually with the .* notation to specify all fields.

Similar to CLEAR FORM, the CLEAR field-list is typically used when the program is not inside a dialog block execution controlling the form fields. For example, after a database query with a CONSTRUCT instruction, you might want to clear all search criteria entered by the user with this instruction, to cleanup the form.

Note: CLEAR field-list clears the field values and resets the TTY attributes to NORMAL.

The CLEAR field-list instruction is usually not needed if the program is always in the context of a dialog controlling the form fields.

Example

  CONSTRUCT BY NAME sql
     ON s_customer.*
     ...
  END CONSTRUCT
  CLEAR s_customer.*
  ...