07-24-2024, 03:50 AM
I need to check my mouse-click positions several times, but seem to be stuck with its first location each time.
This is a simplified version of what I'm using; What am I doing wrong? (pardon the GoTo's)
This is a simplified version of what I'm using; What am I doing wrong? (pardon the GoTo's)
Code: (Select All)
GetFirst: ' to find first mouse position
Locate 20, 30: Print "Choose first location"
m% = _MouseInput ' prepare mouse
If _MouseButton(1) Then ' get left-mouse
MX = _MouseX: MY = _MouseY ' get horiz and vert position
Print MX, MY
GoTo GetSecond ' and go to GetSecond
Else GoTo GetFirst ' if left-mouse not pressed go back and try again
End If
GetSecond: ' to find second mouse position
While _MouseButton(1): Wend ' wait for left-mouse to restore
Print "Choose second location"
'm% = _MouseInput ' prepare mouse (is this needed again?)
If _MouseButton(1) Then ' get left-mouse again
MX = _MouseX: MY = _MouseY ' get new horiz and vert position
Print MX, MY
Sleep
Else GoTo GetSecond ' if left-mouse not pressed go back and try again
End If
Sleep
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) ![Big Grin Big Grin](https://qb64phoenix.com/forum/images/smilies/biggrin.png)
Please visit my Website at: http://oldendayskids.blogspot.com/
![Big Grin Big Grin](https://qb64phoenix.com/forum/images/smilies/biggrin.png)
Please visit my Website at: http://oldendayskids.blogspot.com/