qwerty
02-17-2009, 02:46 PM
i find myself in the situation where i want to loop through a table reading the data from every other line in the table into a list box, so i was thinking to try using Table.Concat with no separator declared, and a matching index for the start and stop points.... would this effectively allow me to read just that one line ?
here is what i have so far
-- Transfer from chunkTable to List Box --
item_count = Table.Count(chunkTable);
ind = 1;
ListBox.DeleteItem("FileSizeList", LB_ALLITEMS);
for x = 1, (item_count/2) do
ListBox.InsertItem("FileSizeList", x, "Piece ".. x, Table.Concat(chunkTable, "", ind, ind));
ind = ind+2;
ListBox.SetUpdate("FileSizeList", true);
end
i'm not entirely sure if i need to use the SetUpdate thing or not, i only really need it to update at the end of the loop, but if it takes a while to populate then updating on each step could be handy
i also have the same data in a text file, but thought it might be easier to do it this way from the table
here is what i have so far
-- Transfer from chunkTable to List Box --
item_count = Table.Count(chunkTable);
ind = 1;
ListBox.DeleteItem("FileSizeList", LB_ALLITEMS);
for x = 1, (item_count/2) do
ListBox.InsertItem("FileSizeList", x, "Piece ".. x, Table.Concat(chunkTable, "", ind, ind));
ind = ind+2;
ListBox.SetUpdate("FileSizeList", true);
end
i'm not entirely sure if i need to use the SetUpdate thing or not, i only really need it to update at the end of the loop, but if it takes a while to populate then updating on each step could be handy
i also have the same data in a text file, but thought it might be easier to do it this way from the table