BEFORE DELETE clause

BEFORE DELETE clause is executed after the user presses the Delete key during the INPUT ARRAY statement, and before the record is actually deleted. There can be only one BEFORE DELETE clause in an INPUT ARRAY statement.

 

If the EXIT INPUT is specified in the BEFORE DELETE clause, the row will not be deleted and the INPUT ARRAY statement will be terminated when the user presses the Delete key.

 

The statement clause of the BEFORE DELETE control block can include:

CANCEL DELETE Keywords

CANCEL DELETE keywords within the BEFORE DELETE clause can cancel either all the delete actions or the deleting can be canceled for individual screen records of the currently displayed form file.

The canceled delete operation does not affect the active set of rows that are being processed by the INPUT ARRAY statement

 

BEFORE DELETE clause is terminates when 4GL executes the CANCEL DELETE keywords and the program control is passed to the next clause following the BEFORE DELETE clause. You cannot specify the CANCEL DELETE keywords outside the BEFORE DELETE clause.

 

CANCEL DELETE keywords of the BEFORE DELETE clause and the CANCEL INSERT keywords of the BEFORE INSERT clause have similar effect. As an example, the programmer might want the user to delete all but one of the rows, but once a row is deleted, a replacement row cannot be inserted in its place:

DEFINE n_rows INTEGER

DEFINE arrayname ARRAY[100] OF RECORD

INPUT ARRAY arrayname WITHOUT DEFAULTS FROM s_array.*

ATTRIBUTES(COUNT = n_rows, MAXCOUNT = n_rows,

INSERT ROW = FALSE, DELETE ROW = TRUE)

BEFORE INSERT

CANCEL INSERT

BEFORE DELETE

LET n_rows = n_rows - 1

IF n_rows <= 0 THEN

CANCEL DELETE

END IF

END INPUT

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.