Select Case...?
BlitzMax Forums/BlitzMax Beginners Area/Select Case...?
| ||
Why Can't I do this? Select MapArray[x,y].frame case 1 to 10 dostuff! =========== Do I have to code it the long way by providing a case for each frame. ie. case 1 dostuff case 2 do stuff ???? [edit] Yeah, I had to do it the long way. :) |
| ||
You can separate cases with commas if you preferSelect MapArray[x,y].frame Case 1,2,3,4,5,6,7,8,9,10 Case 11,12,13,14,15,16,17,18,19,20 ' ETC.. End Select It's not as readable, IMO, but I think it works. I think this would also work? Select True Case MapArray[X,Y].Frame>=1 And MapArray[X,Y].Frame<=10 Case MapArray[X,Y].Frame>=11 And MapArray[X,Y].Frame<=20 ' ETC.. End Select |
| ||
Hi. I tried the second method but it borks up collision for some reason. Can't quite figure out why. I'll try your first method now. Thanks for your help. :) edit: The first method works perfect. Thanks :) |
| ||
Try using an If-Else chain, which I believe the select-case gets turned into anyway? |