newbie level question

Jim Ault JimAultWins at yahoo.com
Wed Mar 12 15:09:32 EDT 2008


Correction:
Sorry about the confusion I might have caused.
I forgot to put one line in the sequence of message box commands:
The first line is a simple declaration of the global you want to use:

global gVarToHoldString
--now the rest should work
 put "the dog barks" into gVarToHoldString
 put gVarToHoldString
 put cr & word 1 of gVarToHoldString after msg
 put msg & cr & cr & gVarToHoldString & " loudly"


 Jim Ault
Las Vegas

On 3/12/08 10:54 AM, "Jim Ault" <JimAultWins at yahoo.com> wrote:

> On 3/12/08 9:35 AM, "Colin Holgate" <coiin at rcn.com> wrote:
> 
>> Oh, this will make you all laugh no doubt, but how do I use variables
>> in the message box? For example, if I try this:
>> 
>> get 10
>> put it
>> 
>> the word "it" is put into the message box. What would I do
>> differently in order to see the value "10" appear?
> 
> Mark's answer is a good one.
> The 'it' container is a special one for Rev, so you need to learn how it
> works, usually by testing to make sure what happens is what you want.
> 
> Another way to use variables is to create a global in the message box, then
> use that global :
> 
> put "the dog barks" into gVarToHoldString
> 
> Now Revolution program stores the string in a variable that will persist
> until you quit Rev.  Opening and closing stacks will not affect this value
> unless they also access the 'aaaa' global.
> 
> So:
> --run each of these in the msg box to test the effect
> 
> put "the dog barks" into gVarToHoldString
> put gVarToHoldString
> put cr & word 1 of gVarToHoldString after msg
> put msg & cr & cr & gVarToHoldString & " loudly"
> 
> Caution when using the multi-line message box as there are slight
> differences from running the same code in a script container, such as the
> stack script.
> 
> Jim Ault
> Las Vegas





More information about the use-livecode mailing list