How do I scan all the objects on a card?

Scott Rossi scott at tactilemedia.com
Tue Feb 11 04:39:01 EST 2003


Recently, Graham Samuel wrote:

> I tried an experimental button
> with this script:
> 
> 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
> 
> But this produced a runtime error. I suspect that "control i" in this
> context does not translate to stuff like "graphic i" or "image i" or
> "field i" according to circumstances, a usage I have so far found I
> have to organise myself. I tried a number of variations, but no luck
> so far.

This is failing because your repeat counter variable is "X" while you used
variable "i" to reference the control numbers.  Change the i to an x and
your script will work fine.

Regards,

Scott Rossi
Creative Director

Tactile Media, Multimedia & Design
Email: scott at tactilemedia.com
Web: www.tactilemedia.com




More information about the use-livecode mailing list