Chopping Up A Paragraph into chunks

DunbarX at aol.com DunbarX at aol.com
Tue Jan 25 22:57:38 EST 2011


This should   be done with the wordoffset function, using the "words to 
skip" to advantage.

But this more readable. I had a field "source" with some text, and a fld 
"theResults". In a button script:

on mouseUp
   put "" into fld "theResults"
   put fld "source" into temp
   repeat while the number of words of temp <> 0
     get random(8)
     put word 1 to it of temp & return after fld "theResults"
     delete word 1 to it of temp
   end repeat
end mouseup

Straigthtforward. But try it with the wordOffset function, keeping track of 
where you are and updating the "words to skip". You can play around with 
your field making gadgetry; change the repeat loop by adding a counter so that 
a new field is created each pass. Put the data into those new fields 
instead of appending to the "theResults" field.

Craig Newman



More information about the use-livecode mailing list