How do I scan all the objects on a card?

Björnke von Gierke bvg at mac.com
Tue Feb 11 09:48:00 EST 2003


You can only use the "repeat for each" with chunks (lines, chars etc.)
But you can try this:

repeat for the number of controls of this card times
   add one to i
   put (the name of control i of this card) into line i of field "MyList"
end repeat

This will be something faster (around 1 tick per every 10 controls) 
then a "repeat with".
It is true that the number of the controls can be the same (when there 
are grouped controls on the card). However the layer property is always 
unique (wen you look only at the controls of one card), so maybe there 
is some cheating and property-exchanging going on here?


On Dienstag, Feb 11, 2003, at 10:14 Europe/Zurich, 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