Strange contents of long name

Alex Tweedly alex at tweedly.net
Wed Jan 16 13:03:23 EST 2013


On 16/01/2013 08:21, Kay C Lan wrote:

> Interestingly if you:
>
> put "z" into fld "Field" of group "group" of card "card"
>
> no warning it just goes into the first field you named "Field" in the
> first group you named "group" of the first card you named "card".
>
> I wouldn't be surprised if someone on this List hasn't used such a
> quirk to some mind blowing advantage.

It's even worse (IMHO) than that.

create a field "F"
put it inside group "G"
create another field "F"

Then you have two fields called F, and their long names are
   field "F' of group "G" of card "whatever" of stack "something"
and
   field "F' of card "whatever" of stack "something"

i.e. different long names.
Then
    put "some text" into field "F" of this card

it puts the text into the lowest-layer-numbered field "F", regardless of 
whether its long name matches or not.

This means that if you use someone's custom control, and it happens to 
contain a control which has the same name as a control you create 
locally, then you have (apparently) no way to reliably access your own 
control by name - any such reference will match the lowest-layered one 
with the same name.

Am I missing something ? It seems like this would be a serious 
impediment to reliable custom controls.
Do we need to convert everything to use IDs rather than names ?

-- Alex.




More information about the use-livecode mailing list