Creating variables

Mark Schonewille m.schonewille at economy-x-talk.com
Wed Aug 6 07:34:23 EDT 2008


Hi François,

When a variable contains a reference to an object and you can't use  
the put command with that variable because it would change the  
variable rather than the object referred to, use the text property:

set the text of myFieldReference to "some text"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Benefit from our inexpensive hosting services. See http://economy-x-talk.com/server.html 
  for more info.

On 6 aug 2008, at 13:25, François Chaplais wrote:

>
> Le 5 août 08 à 16:12, Eric Chatonet a écrit :
>
>> Bonjour Eric,
>>
>> Le 6 juil. 08 à 22:38, Éric Miclo a écrit :
>>
>>> repeat for each line lineListOne in listOne
>>>  repeat for each line lineListTwo in listTwo
>>>    put (lineListOne & lineListTwo) into varName
>>>    put "test" into varName
>>>  end repeat
>>> end repeat
>>
>> put <whatever> into tContents
>> do "put tContents into" && varName
>>
>> Best regards from Paris,
>> Eric Chatonet.
>>
>
> a more general digression on manipulating rev object by names and  
> not by value:
>
> as far as I am concerned, it seems to me that, for instance, if  
> <name> is the long name of a filed, if you want to put empty into  
> the field with name <name>, then you have to script
> do "put empty into" && <name>
> and then probably have to deal with the quotes in the long name (it  
> seems I have had to do this countless times when executing a loop on  
> object names in a group/card/whatever)
>
> The OP was concerned to setting a variable value when knowing only  
> its name, and Eric's answer was to use the "do" command. This is  
> something I have used quite frequently in my HC days, but  
> unfortunately use of the "do" command is severely restricted in  
> standalones (with reasons I can understand).
>
> I was hoping that the reference operator @ would do the trick, i.e.  
> passing the name of the variable instead of the variable itself. The  
> following button handler works:
<snip>


More information about the use-livecode mailing list