Usage / DIALOG control instructions |
The CLEAR field-list and CLEAR SCREEN ARRAY screen-array.* instructions clear the value buffer of specified form fields. The buffers are directly changed in the current form, and the program variables bound to the dialog are left unchanged. CLEAR can be used outside any dialog instruction, such as the DISPLAY BY NAME / TO instructions.
As DIALOG is typically used with the UNBUFFERED mode, there is no reason to clear field buffers in a DIALOG block since any variable assignment will synchronize field buffers. Actually, changing the field buffers with DISPLAY or CLEAR instruction will have no visual effect if the fields are used by a dialog working in UNBUFFERED mode, because the variables bound to the dialog will be used to reset the field buffer just before giving control back to the user. So if you want to clear fields, just set to NULL the variables bound to the dialog. However, when using a CONSTRUCT, you may want to clear fields with this CLEAR instruction, as there are no program variables bound to fields (with CONSTRUCT, only one string variable is bound to hold the SQL condition).
A screen array with a screen-line specification doesn't make much sense in a GUI application using TABLE containers, you can therefore use the CLEAR SCREEN ARRAY instruction to clear all rows of a list.