LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
...
put fld "whatever holds tText" into tText
repeat for each line L in tText
## Get second to last item:
put item 2 to -1 of L & CR after tNewText
end repeat
## Get rid of trailing CR
delete char -1 of tNewText
put tNewText into fld "whatever holds tText"
...
on mouseup -- -- 1320 milliseconds
put the milliseconds into old
repeat with i = 1 to 10000
put i & "," & random(100) & cr after tText
end repeat
put 0 into tCount
repeat for each line L in tText
add 1 to tCount
-- delete item 1 of L
delete item 1 of Line tCount of tText
end repeat
put "TimeUsedMilliseconds = " && the milliseconds - old & cr & tText
end mouseup
on mouseup -- 10589 milliseconds
put the milliseconds into old
repeat with i = 1 to 10000
put i & "," & random(100) & cr after tText
end repeat
repeat with i = 1 to the num of lines of tText
delete item 1 of line i of tText
wait 1 milliseconds with messages
end repeat
put "TimeUsedMilliseconds = " && the milliseconds - old & cr & tText -- 10589
end mouseup
Thanks a lot Klaus and Jean-Marc.
I was not sure if "repeat for each L ..." Is bug or "red only" - I couldn't find the answer anywhere, so decided to ask you friends.
I started to runaround with Jean-Marc solution, but drop it as slow, asked here and gone home to eat something and go sleep. I was hope to find there solution tomorrow morning, didn't expect such quick answers.
Thanks a lot once more.