problem with deleting buttons in a loop

J. Landman Gay jacque at hyperactivesw.com
Sat Sep 6 12:44:00 EDT 2003


On 9/6/03 12:09 PM, Björnke von Gierke wrote:

> i am deleting buttons in a loop, but somehow there is always a button 
> that does not get deleted,  and I cant find out why. There is one other 
> button in the group.
> Can anyone explain this behaviour? Is this a bug, or am I making a 
> stupid mistake?
> 
>   put the number of buttons in group "points" into a
>   repeat with x = a down to 1
>     if word one of the short name of button x = "point" then
>       delete button x
>     end if
>   end repeat
> 

Change two lines:

   if word one of the short name of button x of group "points" = "point" 
then
   delete button x of group "points"

As it is written originally, the scripts looks at and deletes buttons 
regardless of whether they are in a group or not.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list