mouse wheel prob

Blitz3D Forums/Blitz3D Beginners Area/mouse wheel prob

How can i stop the tileindex from increasing/decreasing constantly?

I thought I could use the code

mousewheel=MouseZ ()

If mousewheel>0 Then tileindex=tileindex+1 : mousewheel=0
If mousewheel<0 Then tileindex=tileindex-1 : mousewheel=0

so that 'tileindex' would go up or down once then set 'mousewheel' to 0. What happens is once I move the mousewheel up or down it cycles through my tiles and doesnt stop.

Any ideas why?
thanks