Speeding up array initialization
rcozens at pon.net
Sat Nov 22 09:04:53 CST 2003
>Let's say I have a variable S made of 100 lines of 100 items each,
>and I want to initialize each item of each line to 0.
put empty into S
repeat with x = 1 to 100
put empty into item 100 of line x of S -- creates a string of 99 commas
replace "," with "0," in S
replace return with "0"&return in S
If you know regular expression syntax, you can probably replace the
two replace commands with one call to replaceText.
CCW, Serendipity Software Company
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode