"do" statements and value function
bonnmike at gmail.com
Sun Jun 19 18:28:13 CDT 2011
Put value(x) into tNumberOfRecords ? isn't exactly what the example I
mentioned does. (and this is where my dictionary docs seem to be wrong)
Say you have an unspecified number of "things" you want to put into their
own variables (yeah, I know, use an array, but for example purposes arrays
So, if you want to put each line of a random number of lines into its very
own variable, this is where the example I cited comes in.
*put 1 into tcounter*
*repeat for each line theLine in theData*
*do "put theData into myVar" & i*
*add 1 to tcounter*
This will put the first line into myVar1 line 2 into myVar2 etc on down the
The example in the dictionary says do "put" && x && "into tNumberOfRecords"
& x *-- might become "put 3 into*
* tNumberOfRecords" *
The comment explanation misses the value of x being part of the newly
created variable name. So if x was 3, it would put 3 into tNumberofrecords3
And as bvg said, a do script can be a real full script.
More information about the use-livecode