You use:
Quote:
|
While FIELD(emp_tbl).TableBody.ChildFields.LastRow is not NULL
|
LastRow is defined as integer not null, therefore it will never be NULL.
Later you do
Quote:
|
FIELD(emp_tbl).DeleteColumn(position = FIELD(emp_tbl).TableBody.ChildFields.FirstRow + i);
|
FirstRow is 1 and I assume that you start with i=LastRow, that is you try to delete column lastrow+1, which doesn't exist.
Why aren't you deleting just column i?
And why a WHILE loop and decrementing the variable i rather than using a FOR loop? Something like this:
Code:
FOR i=FIELD(emp_tbl).TableBody.ChildFields.LastRow DOWNTO 3 DO
FIELD(emp_tbl).DeleteColumn(position = i);
ENDFOR;