TYPES and Deletes

Previous topic - Next topic

MrPlow

Hi,

Just a quick question... I have had bugfor while now with a type not working as I expected after a delete from a TYPE list.

How does a TYPE FOREACH affect looping ? If a delete a different unit and it is in the same loop but not the same current item will the FOREACH index move position if the deleted item is before it??

Hope i made this example clear enough...



Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

kanonet

If you want to delete something from array in a FOREACH loop use DELETE. Never ever use DIMDEL, DIM or REDIM on same array in a FOREACH or things will go horribly wrong!
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

MrPlow

Thanks!

I have sorted out my problem...seems the array shifts when you delete items...so I leave my deleting until after the foreach is complete!

Just just flag items for delete...so good when it works as planned!

G
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs