Question about deleting all the graphics on a card

Thomas J McGrath III 3mcgrath at adelphia.net
Fri Jan 23 07:21:46 EST 2004


you might try:
repeat with i = 1 to the number of graphics
	if exists(the short name of graphic i) then delete graphic(the short 
name of graphic i)
end repeat


On Jan 23, 2004, at 1:07 AM, Doug Lerner wrote:

> The following loop:
>
>   repeat with i = 1 to the number of graphics
>     delete graphic (the short name of graphic i)
>   end repeat
>
> doesn't work right because while the loop is running Rev seems to 
> renumber
> the graphics (hah!) so at some point a "missing object" error will 
> occur.
>
> I can run through the loop twice:
>
> First pass: collect the names of the graphics
> Second pass: delete the graphics
>
> But is there a better way?
>
> Thanks,
>
> doug
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev 
2.1.2


Advanced Media Group
Thomas J McGrath III	• 2003 •	3mcgrath at adelphia.net
220 Drake Road, Bethel Park, PA 15102





More information about the use-livecode mailing list