Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2006
    Posts
    345

    Grin Can i use Table.Concat like this ?

    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

    Code:
    	-- 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

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    FYI, in the for statement, you can use step. Wouldn't that be easier?
    Yossi

  3. #3
    Join Date
    Oct 2006
    Posts
    345
    sorry, you lost me i'm afraid .... but i did find an alternitive way of doing it...

    in the original table, when it was created, there was a number of aditional characters and things in each index which i did not need, or wanted to change, so when i was creating the original table in the function i use for that, i make it create a second table with only the data i needed in each element plus the aditional text i wanted, so now i can use this

    Code:
    	-- Transfer Data from chunkSizeTable to List Box --
    item_count = Table.Count(chunkSizeTable);
    ListBox.DeleteItem("FileSizeList", LB_ALLITEMS);
    for j,k in chunkSizeTable do
    	ListBox.InsertItem("FileSizeList", j, "Piece ".. j, k);
    	ListBox.SetUpdate("FileSizeList", true);
    end

  4. #4
    Join Date
    Nov 2006
    Posts
    233
    Use a loop with a step is what yosik was suggesting

    Code:
    -- A for loop that counts from 1 to 10 in 2's
    min = 0;  -- The number to start at
    max = 10;  -- The number to stop at
    step = 2;  -- The number to count by (in this case 0, 2, 4, ...)
    for count = min, max, step do
    	-- Do something here
    end

  5. #5
    Join Date
    Oct 2006
    Posts
    345
    ok now i'm with you

    and yes, that would have worked better than what i had, but writing a second table on the fly with the first one has actually allowed me to alter the way i display the data which is better for me live and learn as they say


    ok, so thats this one solved ... appreciate the help guys, and i will certainly remember this for next time


    now to find out why my File.GetSize action is returning a value lower than 250mb when applied to a 4.09gb img file :(... back to the search engine i go !

Similar Threads

  1. Table.Concat not working with FileMenu?
    By SonG0han in forum AutoPlay Media Studio 7.5
    Replies: 1
    Last Post: 11-10-2007, 03:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts