Having strange problem with the 'clone' command

Alex Tweedly alex at tweedly.net
Tue Jul 6 19:23:12 EDT 2010



I'm just trying to create a simple array of rectangles .....

I've created one (called, with great imagination :), "R1") which has all 
the correct characteristics, including a width and height of 8

But when I clone it to create my other shapes, the widths and heights 
all come out to 120 instead of 8. I can fix this up (as I do in the 
following code), but I don't understand why that would be necessary (or 
what other properties might be different from what I expect).

>    repeat with y = 0 to 5
>       repeat with x = 0 to 4
>          put "_h01_" & x & y into tName
>          clone grc "R1"
>          set the name of it to tName
>          put the width of grc tName && the width of grc "R1" & CR 
> after field "F"
>          set the loc of grc tName to 100 + 20*x,  150 + 20*y
>          set the width of grc tName to 8
>          set the height of grc tName to 8
>          set the visible of grc tName to true
>          put the width of grc tName && the width of grc "R1" & CR 
> after field "F"
>          put "grc" && quote & tName & quote && "and" & space after 
> tGroupList
>       end repeat
>    end repeat
>
what shows up in the field is
> 120 8
> 8 8
> 120 8
> 8 8
> 120 8
> 8 8
> 120 8
> 8 8
> etc.

I tried to create a tiny sample stack to show the problem, and initially 
succeeded, but at some point as I tried minor variations, it started 
working - and now I can't get it to fail again.  The time it started 
working was when I changed
    clone invisible grc "R1"
to simply
    clone grc "R1"
but changing that back didn't cause the problem to recur.

Any ideas ?
Thanks
-- Alex.






More information about the Use-livecode mailing list