AFTER DELETE block

The AFTER DELETE block is executed each time the user deletes a row, after the row has been deleted from the list.

When an AFTER DELETE block executes, the program array has already been modified; the deleted row no longer exists in the array (except in the special case when deleting the last row). The ARR_CURR() function returns the same index as in BEFORE ROW, but it is the index of the new current row. The AFTER ROW block is also executed just after the AFTER DELETE block.

Important: When deleting the last row of the list, AFTER DELETE is executed for the delete row, and DIALOG.getCurrentRow() / ARR_CURR() will be one higher as DIALOG.getArrayLength() / ARR_COUNT(). You should not access a dynamic array with a row index that is greater than the total number of rows, otherwise the runtime system will adapt the total number of rows to the actual number of rows in the program array. When using a static array, you must ignore the values in the rows after ARR_COUNT().
In this example, the AFTER DELETE block is used to renumber the rows with a new item line number (note ARR_COUNT() may return zero):
INPUT ARRAY p_items WITHOUT DEFAULTS
      FROM s_items.*
   ...
   AFTER DELETE
     LET r = arr_curr()
     FOR i=r TO arr_count()
       LET p_items[i].item_lineno = i 
     END FOR
 ...