Question about deleting all the graphics on a card

Doug Lerner doug at webcrossing.com
Fri Jan 23 02:31:56 EST 2004


On 1/23/04 3:18 PM, "Sarah Reichelt" <sarahr at genesearch.com.au> wrote:

> repeat the number of graphics times
>  delete graphic 1
> end repeat

Interesting one. I like your second one better though! :)

> 
> or if you want to check the name of any on the loop:
> 
> repeat with i = the number of graphics down to 1
>  delete graphic (the short name of graphic i)
> end repeat

The idea of this one being that since you are going down in reverse order
the numbers won't get reset in the middle of the loop? Good idea.

doug

> 
> Cheers,
> Sarah
> sarahr at genesearch.com.au
> http://www.troz.net/Rev/
> 
> On 23 Jan 2004, at 4:09 pm, 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



More information about the use-livecode mailing list