I am an old HyperCarder, so I tend to attack things in an old fashioned way. I use arrays, but think that the decisions needed here may not use them to any great advantage. I am usually wrong.
I tried this with a worst case list of 20,000 lines, that is, no adjacent lines in your sense, to maximize the length of the derived list. It works fine, but took three minutes to run. The resulting list was 60,000 lines long. Given a field "yourField" with lots of data in it, a field for the results, and a button, place this in the button script: on mouseup put fld 1 into temp repeat for each line tLine in temp put item 1 of tLine - 10 & "," & 0 & return before tLine put return & item 1 of line 2 of tLine + 10 & "," & 0 & return after tLine put tLine after accum end repeat sort accum numeric by item 1 of each delete line 1 of accum delete the last line of accum repeat with y = the number of lines of accum down to 1 switch case item 1 of line y of accum = item 1 of line (y-1) of accum and item 2 of line y of accum = 0 delete line y of accum break case item 1 of line y of accum = item 1 of line (y-1) of accum and item 2 of line y-1 of accum = 0 delete line y-1 of accum break end switch end repeat put accum into fld 2 end mouseup Someone will find a better algorithm. Craig Newman _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode