deleting multiple controls all at once
Klaus Major
klaus at major-k.de
Sun Feb 12 05:32:50 EST 2006
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
More information about the use-livecode
mailing list