deleting multiple controls all at once
MisterX
b.xavier at internet.lu
Sun Feb 12 05:54:11 EST 2006
could be even faster if you did
repeat with n = 1 to 300
try
delete control ("thing." & n)
end try
end repeat
who cares if it fails...
now, this obviously ignores the error but may prepare some debugging info or
do stuff for debugging. It would be handy to have a real ignore and end
ignore control statement in transcript for these cases... something that
just try and continues regardless of errors...
comments?
cheers
Xavier
http://monsieurx.com - doing the taoo ;)
> IF exists(control ()) THEN
> delete control("thing." & n)
> END IF
> END REPEAT
>
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
> Klaus Major
> Sent: Sunday, 12 February, 2006 11:33
> To: How to use Revolution
> Subject: Re: deleting multiple controls all at once
>
> Hi Josh,
>
> > Is there a way to delete a bunch of controls whose names match a
> > wildcard expression like "thing.?" or "thing.??" all at once
> > elegantly?
> >
> > example:
> >
> > thing.23
> > thing.46
> > thing.4
> > thing.142
> >
> >
> > delete all controls named "thing." & ?? doesn't work :-)
> >
> >
> > Friends don't let friends do this:
> >
> > REPEAT with n = 1 to 300
> > IF exists ("thing." & n) THEN
> > delete "thing." & n
> > END IF
> > END REPEAT
>
> try this:
>
> REPEAT with n = 1 to 300
> IF exists(control ("thing." & n)) THEN
> delete control("thing." & n)
> END IF
> END REPEAT
>
> > :P
>
> :-)
>
>
> Regards
>
> Klaus Major
> klaus at major-k.de
> http://www.major-k.de
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list