According to the documentation (2.11), the AUTO APPEND attribute in INPUT ARRAY is supposed to prevent the creation of temporary rows. I am getting no different behavior whether the attribute is TRUE or FALSE.
Form:
LAYOUT
VBOX
TABLE
{
[F1 |F2 ]
[F1 |F2 ]
}
END -- TABLE
END -- VBOX
END -- LAYOUT
ATTRIBUTES
EDIT F1 = FORMONLY.cfield1, TITLE="Field1";
EDIT F2 = FORMONLY.cfield2, TITLE="Field2";
INSTRUCTIONS
screen record s_list (FORMONLY.cfield1,FORMONLY.cfield2)
Application:
DEFINE p_list DYNAMIC ARRAY OF RECORD
field1 CHAR( 8 ),
field2 CHAR( 8 )
END RECORD
MAIN
DEFINE nArrCount,iArrCurr SMALLINT
CLOSE WINDOW SCREEN
OPEN WINDOW w_test AT 1,1 WITH FORM "test"
attributes(TEXT="Test program")
CALL p_list.appendelement()
LET p_list[p_list.getLength()].field1 = "John"
LET p_list[p_list.getLength()].field2 = "Smith"
CALL p_list.appendelement()
LET p_list[p_list.getLength()].field1 = "Jane"
LET p_list[p_list.getLength()].field2 = "Jones"
INPUT ARRAY p_list WITHOUT DEFAULTS FROM s_list.* ATTRIBUTE(UNBUFFERED, AUTO APPEND=FALSE)
BEFORE ROW
DISPLAY "BEFORE ROW: Row ",arr_curr()," of ",p_list.getLength()
BEFORE INSERT
DISPLAY "BEFORE INSERT: Row ",arr_curr()," of ",p_list.getLength()
AFTER INSERT
DISPLAY "AFTER INSERT: Row ",arr_curr()," of ",p_list.getLength()
AFTER ROW
DISPLAY "AFTER ROW: Row ",arr_curr()," of ",p_list.getLength()
END INPUT
CLOSE WINDOW w_test
END MAIN
The output is always:
Launch application: BEFORE ROW: Row 1 of 2
Click on row 2: AFTER ROW: Row 1 of 2
BEFORE ROW: Row 2 of 2
Click 'Delete': AFTER ROW: Row 2 of 1
BEFORE ROW: Row 2 of 2
BEFORE INSERT: Row 2 of 2
And a new row is added.