Robert Sneidar wrote:
put 1 into mcnt
repeat for each line tline in mlist
   put empty into word 1 of tline
   put tline into line mcnt of mlist
   put mcnt + 1 into mcnt
end repeat

FWIW, doing the data collection with the form "put...into line..." loses much of the performance value of using "repeat for each", as it requires the engine to crawl through mlist looking for mcnt number of CRs each time through the loop.

To counter this, some years ago Scott Raney optimized the "put...after" form, so you could have a second variable as a collector for things you gather during the iteration, and would probably see a snappy performance boost:

  put empty into tNuList
  repeat for each line tline in mlist
     put empty into word 1 of tline
     put tline &cr after tNuList
  end repeat


This practice of collecting from one source and concatenating to a different destination also takes care of the anomalies you noted when attempting to modify the source container within a "repeat for each" loop.

--
 Richard Gaskin
 Fourth World Media Corporation
 ___________________________________________________________
 [EMAIL PROTECTED]       http://www.FourthWorld.com
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to