The Dialog class / ui.Dialog methods |
Deletes a row from the specified list.
deleteRow( name STRING, index INTEGER )
The deleteRow() method deletes the row in the array controlled by the dialog.
The method is similar to deleting an element to the program array, except that internal dialog registers are automatically updated (like the total number of rows returned by getArrayLength()). If the list is decorated with cell attributes, the program array defining the attributes will also be synchronized. If multi-row selection is enabled, selection information is synchronized (i.e., selection flags are shifted up) for all rows after the deleted row.
After the method is called, the row no longer exists in the program array, and the getArrayLength() method will return the new row count.
If the deleteRow() method is called during an INPUT ARRAY that has the focus, control blocks such as BEFORE ROW and BEFORE FIELD will be executed, if you delete the current row. This is required to reset the internal state of the dialog. However, the method does not execute any BEFORE ROW or AFTER ROW control blocks in a DISPLAY ARRAY dialog.
If the deleteRow() method is called during an INPUT ARRAY, and if no more rows are in the list after the call, the dialog will automatically append a new temporary row if the focus is in the list, to let the user enter new data. When using AUTO APPEND = FALSE attribute, no temporary row will be created and the current row register will be automatically changed to make sure that it will not be greater than the total number of rows.
If you pass zero as row index, the method does nothing (if no rows are in the list, getCurrentRow() returns zero).
ON ACTION delete_invalid_rows FOR r = 1 TO DIALOG.getArrayLength("sa") IF NOT s_orders[t].is_valid THEN CALL DIALOG.deleteRow("sa",r) LET r = r - 1 END IF END FOR