Delete item won't work in Repeat for each loop

Ian McKnight iangmcknight at
Wed May 24 17:55:46 EDT 2006

Hi Mark

Thanks for your advice. I knew that there might be a problem here nut
I only ever intended (in this instance) to delete items in lines and
not the lines themselves. I had forgotten about the down to option

Thanks for the reminder.


Ian Mcknight

On 24/05/06, Mark Schonewille <m.schonewille at> wrote:
> Hi Ian,
> When you delete items, the number of items gets smaller while the
> variable that counts the items goes up. At some point, you're trying
> to delete items that don't exist. Use "down to" to avoid this:
> repeat with x = number of lines of myList down to 1
>    delete line x of myList
> end repeat
> (in this simple example, you can also use "delete last item", obviously)
> Best,
> Mark

More information about the Use-livecode mailing list