Syntax to increment variable names in repeat loop

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Wed May 25 15:16:20 EDT 2011


Thanks for the confirmation Chris - and the insights into how to create an array of discrete containers (such as a grid), when that becomes appropriate.
Best,
Keith..     

On 24 May 2011, at 14:56, Nonsanity wrote:

> Arrays are the way to go there, but if you really do need to work with
> constructed variable names, do is probably the only way to set such a value.
> The following code clip shows how you can get the value of a constructed
> variable name:
> 
> put 111 into var1
> put 222 into var2
> put 2 into whichVar
> put merge( "[[var" & whichVar & "]]" ) into msg
> 
> ~ Chris Innanen
> ~ Nonsanity
> 
> 
> On Tue, May 24, 2011 at 7:47 AM, Keith Clarke <
> keith.clarke at clarkeandclarke.co.uk> wrote:
> 
>> Thanks, Jim, The 'do' command looks useful as a mechanism for combining
>> disparate elements - I'll add it to my armoury.
>> 
>> The multi-dimensional array should keep the XML strings related but
>> separate for post processing.
>> I'm also setting a custom property on the stack as the array - to provide
>> simple database-free persistence over time and across cards, should I need
>> to access the XML (or more likely, cross-reference the keys) from elsewhere
>> in the stack.
>> Best,
>> Keith..
>> 





More information about the use-livecode mailing list