custom props woes

Klaus major-k klaus at major-k.de
Fri Oct 18 12:49:48 EDT 2013


Hi Richard,

Am 18.10.2013 um 18:42 schrieb Richard Gaskin <ambassador at fourthworld.com>:

> FWIW I'm not able to reproduce the issue in v6.1.2 with these scripts, each in a different button on one card:
> 
> on mouseUp
>   global gName
>   put "foo" into tA[1]
>   put "bar" into tA[2]
>   put "c"& the seconds into gName
>   set the gName of this cd to tA
> end mouseUp
> 
> on mouseUp
>   global gName
>   put the gName of this cd into tA
>   put the keys of tA
> end mouseUp
> 
> When I run the second script the Message Box shows:
> 
> 1
> 2
> 
> ...which are the valid keys of the array.

Yes, i also made a little test stack with these 2 buttons and everything worked fine!?

> What's shown working here is:
> - Property access by concatenated variable name

Yep

> - Preservation of the property value as an array

Yep

> Looking for differences between my test and yours:
> - How is "the seconds" stored in your scripts?

as a number in a list, as I said the concatenated cp name is defintiviely correct!

What is making this so funky are the facts that
1. I use arrays in CPs everywhere in that stack and access them WITH concatenated names!
2. If I change the content of that CP to a string ("a string") then I get that string!

This only happens with ONE specific group in my stack, everythong else is fine!?

> - How are you testing whether the array is empty?

In the debugger :-)

Thanks for taking the time to answer!
I found a workaround and thats OK for me in the moment :-)

> --
> Richard Gaskin

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major-k.de





More information about the use-livecode mailing list