process data in steps of 50 lines

Matthias Rebbe matthias_livecode at me.com
Tue Jun 7 08:05:23 CDT 2011


Hi,

i have a variable which contains data with unspecified number of lines. It can be 3 but it can also be 9000 or whatever.

I need to do some calculations with each line of that data, but want to do it in steps of e.g. 50 lines.

I thought i would do that with 2 repeat loops ( one within the other). 

Something like this


repeat with i = 1 to the number of lines of DATA step 50

      repeat with k = 0 to 49
           do what ever with line (i+k) of DATA
     end repeat

end repeat


I could access  each line then in the repeat loop with line (i+k), but how do i take care if the number of lines are not a multiple of 50?

Is my solution the right one or is there a better way?

Regards,

Matthias





More information about the use-livecode mailing list