Dear all,
after 3 years im trying again with Basic4pcc, i have an old project
which i need to rewrite.
starting up again, i facing the issue with tables, after filling up with
new data seems fine, but after table1.clear and fill up again the table
is not empty its add data the the current rows
like i have 1940 files, after changing folder with 3 files, i have after clear
the table 1943 files in the table?
how can i solve.
thanks a lot.
Nice solution i tried, but after two times switching i says INDEX 970 is hoger than the row counts, before the message a mxgbox displays 1939 items,
really strange.
Nice solution i tried, but after two times switching i says INDEX 970 is hoger than the row counts, before the message a mxgbox displays 1939 items,
really strange.
Table.Clear should work without problems so I would check your code carefully and maybe post it here for us to look at at if it is not clearing properly.
The code that fails is trying to remove non-existent rows as the table is compacted after each remove. You could try
B4X:
For i=0 To Table.RowCount-1
Table.RemoveRow([COLOR="Red"]0[/COLOR])
Next
or
B4X:
For i=o Table.RowCount-1 To 0 Step -1
Table.RemoveRow(i)
Next
Table.Clear should work without problems so I would check your code carefully and maybe post it here for us to look at at if it is not clearing properly.
The code that fails is trying to remove non-existent rows as the table is compacted after each remove. You could try
B4X:
For i=0 To Table.RowCount-1
Table.RemoveRow([COLOR=red]0[/COLOR])
Next
or
B4X:
For i=o Table.RowCount-1 To 0 Step -1
Table.RemoveRow(i)
Next
I couldn't find any mention of it in the Help (when I first stumbled over it) but the end-value of a For ... To is only evaluated once at commencement. So the above gives you the full iteration and does not end too soon as the count decreases!