Referencing a variable?

Ian Leigh ianl at mac.com
Sun Nov 27 20:44:11 EST 2005


Many thanks Alex for giving me this solution. I don't understand why  
it will only work with the do command. If you try exactly the same  
command normally it doesn't work, why is that?

Cheers

Ian


On 28 Nov 2005, at 01:19, Alex Tweedly wrote:

> Ian Leigh wrote:
>
>> Hello all,
>>
>> I would like to do the following:
>>
>> Put a variable name into another buffer variable.
>> Reference the actual variable but using the buffer variable.
>>
>> So I only have the name of the variable in the buffer but I want  
>> to  put a value into the actual variable only by using the  
>> variable name  which is stored in the buffer.
>>
>> Does this make sense and can it be done? I thought simply :
>>
>> put 123 into "buffer"
>>
>> might work but it doesn't work that way. I have also tried  
>> various  adds and used the value command too but I can't seem to  
>> figure it  out. Any insight would be appreciated.
>
> Here's *an* answer - I think it might be the answer to the question  
> you were asking :-)
>
> put 123 into myVariable    -- give it an initial value
> put "myVariable" into otherVariable   -- put its name into another  
> variable
> do "put 456 into " & otherVariable    -- use that other variable to  
> access the original one
> put myVariable & cr after msg    -- and output it to check we  
> succeeded
>
> this should put out 456, showing that the 3rd line did indeed do  
> what we wanted.
>
> -- 
> Alex Tweedly       http://www.tweedly.net
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.8/183 - Release Date:  
> 25/11/2005
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list