How do I scan all the objects on a card?
Sarah
sarahr at genesearch.com.au
Tue Feb 11 17:35:15 EST 2003
Hi Graham,
I think what is confusing you about control numbers is that they are
not static, but they are unique. They represent the ordering of the
controls on the card, so they have to be unique as no two controls can
be at the same position in the layering list. However these numbers
change if you alter the layer of any control, so control 4 might refer
to different objects at different times. This still provides a
perfectly valid way to refer to all your objects in a single loop.
While "repeat for each" is a much faster method of looping than "repeat
with", I think the difference is only significant when you have a large
number of repeats. I don't imagine that the number of controls on a
card can be up in the thousands where using "repeat with" might be a
problem.
I am one of those who have found that scripting my own geometry
settings in a resizeStack handler is much the most reliable way to go.
I am hoping that the GM will be improved in Rev 2, but scripting your
own is not that hard and works well.
Cheers,
Sarah
On Tuesday, February 11, 2003, at 09:43 pm, Graham Samuel wrote:
> Oops, I just wrote:
>
> on mouseUp
> repeat with X=1 to the number of controls of this cd
> put (the name of control i of this cd) into line i of fld "MyList"
> end repeat
> end mouseUp
>
> Of course it should have been
>
> repeat with i = 1...
>
> So it does work (though "repeat for each..." doesn't. But what about
> my objection from the transcript dictionary (the implication that the
> numbers aren't unique?). Still I admit to being somewhat red-faced,
> and will work from there. Still not sure about the GM.
>
> Apologies
>
> Graham
> --
> -------------------------------------------------------------------
> Graham Samuel / The Living Fossil Co. / UK & France
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list