Selecting a Variable name by Script

Dennis Brown see3d at writeme.com
Sun May 1 20:46:52 EDT 2005


Alex,

Thanks, I can make that work.

Dennis

On May 1, 2005, at 8:42 PM, Alex Tweedly wrote:

> Dennis Brown wrote:
>
>> I have been trying to get the example in the Rev documentation to 
>> work in my script:
>>
>> global gVariable1
>> on test
>>   put 1 into x
>>   put 50 into ("gVariable"&x)
>> end test
>>
>> it won't "Apply". It gives me a bad destination error.
>>
>> it works fine with things like field names, but not variables.
>>
>> I have 10 buttons that I want to use to save or recall info from ten 
>> sets of arrays.  I just wanted to write one script to do the work 
>> instead of duplicating the script ten times in each button with just 
>> the number after the variable name different (the ten button work a 
>> bit like radio buttons).  However, I can't figure out how to do this 
>> in Rev if the above method will not work.
>>
>> Any Ideas?
>
> global gVariable1
> on mouseUp
>  put 1 into x
>  put 2 into gVariable1    -- just to be sure it does get changed :-)
>  do "put 50 into gVariable"&x
>  put "we got " & gVariable1 into msg
> end mouseUp
>
> -- 
> Alex Tweedly       http://www.tweedly.net
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 27/04/2005
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the Use-livecode mailing list