Why does this not work ?

Alex Tweedly alex at tweedly.net
Tue Jun 11 04:18:13 EDT 2019


Thank you Peter and Mark.

I guess I see it now - though it's still against *my* intuition :-)

Thanks

Alex.

On 11/06/2019 03:24, Peter Bogdanoff via use-livecode wrote:
> I think that 'item 1 of t1’ has to be resolved to an object reference before it can be used with the vis property. The earlier lines are doing that, but not the last.
>
> It seems that LiveCode has gotten stricter with this in recent versions, requiring “of me” or such when referring directly to a control. Some later version of 8.1 was breaking my existing scripts for this very reason.
>
> Peter
>
>> On Jun 10, 2019, at 8:44 PM, Alex Tweedly via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> OK, this code produces an error - but I can't see why (and I worry about that :-)
>>
>> I have a field inside a group inside a group ....,
>>
>> and the following code :
>>
>>> on mouseup
>>>     local tName, t1, t2
>>>     put the long name of fld "F" into tName
>>>     put tName & ",12,13" into t1
>>>     put "t1" && t1 &CR after msg
>>>
>>>     put item 1 of t1 into t2
>>>     set the vis of t2 to TRUE
>>>     put "t2 was OK" &CR after msg
>>>
>>>     set the vis of (item 1 of t1) to TRUE
>>>     put "using parens OK" &CR after msg
>>>
>>>     set the vis of item 1 of t1 to TRUE       -- this line fails !!
>>>     put "here" &CR after msg
>>>
>>> end mouseup
>> that line fails, with the error message
>>
>>> button "Button": execution error at line 14 (Chunk: error in object expression) near "field "F" of group id 1005 of group id 1007 of card id 1002 of stack "/Users/alextweedly/Dropbox (Personal)/Apps/objectchunk.livecode"
>>>
>> I just cant see why that doesn't work :-)
>>
>> If I use parentheses, or if copy the first item over to a different variable), then it is all OK. But doing it directly (AFAICT) should work, and doesn't. What am I misunderstanding ?
>>
>> Thanks
>>
>> Alex.
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list