|
Post by honkytonk on Mar 18, 2020 10:38:49 GMT
Good morning all, The goal is:
cx = MouseX: cy = MouseY select case cx + cy case cx > 183 and cx < 186 and cy > 194 and cy < 197 notice, "USA" end select
But how do you put the "(" and ")"? Thank you
|
|
|
Post by Rod on Mar 18, 2020 12:33:12 GMT
Not on my pc. The cx+cy after select case is wrong. Select case has two modes. Either select case variable then case variable case variable Or select case then case condition case condition.
Your condition code is fine without any () so just remove the cx+cy
|
|
|
Post by honkytonk on Mar 18, 2020 12:44:08 GMT
The goal is to carry out the test with select case (many cases) How to do it? Delete cx + cy ? you want to kill me !!
|
|
|
Post by Rod on Mar 18, 2020 13:10:57 GMT
select case case cx > 183 and cx < 186 and cy > 194 and cy < 197 notice, "USA" case cx > 183 and cx < 186 and cy > 194 and cy < 197 notice, "CANADA” case cx > 183 and cx < 186 and cy > 194 and cy < 197 notice, "MEXICO” end select
No get cx and cy but use them differently. Obviously the numbers would change in the code above to match the map x and y
|
|
|
Post by honkytonk on Mar 18, 2020 13:19:53 GMT
The goal is to carry out the test with select case (many cases) How to do it? Delete cx + cy ? you want to kill me !! This no work but no return error select case cx case (cx > 183) and (cx < 210) select case cy case (cy > 194) and (cy < 220) notice, "YESSS" end select end select wait
And this so select case cx case cx > 183 and cx < 210 select case cy case cy > 194 and cy < 220 notice, "YESSS" end select end select
|
|
|
Post by Rod on Mar 18, 2020 13:40:40 GMT
Stop putting cx and cy after select case they are not needed. Put each unique condition after the case statement as I show.
|
|
|
Post by honkytonk on Mar 18, 2020 17:59:25 GMT
Stop putting cx and cy after select case they are not needed. Put each unique condition after the case statement as I show. Ah yes, I did not know that we could use select case naked it works; thank you so much.
|
|