>But the results are uneven. The program will delete some of the items
>but then stop and give an error message
My impression is that the array is being switched while the process occurs. Try starting from the top array to delete from. I didn't try it myself but I'd assume some of that might be a factor here.