07-24-2024, 11:26 PM
(07-24-2024, 09:08 PM)Pete Wrote: @PhilOfPerth
GOTO gone...
Code: (Select All)Cls: Locate 20, 30: Print "Choose first location: ";
Do
While _MouseInput: Wend
MX = _MouseX: MY = _MouseY
If lb_status% Then If _MouseButton(1) = 0 Then lb_status% = 0 ' Mouse button released.
If _MouseButton(1) And lb_status% = 0 Then
lb_status% = 1 ' Mouse button down
toggle` = toggle` - 1
Select Case toggle`
Case -1: Print MX; MY: Locate 21, 30: Print "Choose second location:";
Case 0: Print MX; MY: Sleep: Cls: Locate 20, 30: Print "Choose first location: ";
End Select
End If
Loop
End
You need to press a key after the second coordinates are displayed. See SLEEP statement. You could change that to a delay or even a blank mouse click to get it to recycle.
GOTO Pete
Thanks Pete. Nice and compact. I intended to get rid of the GOTO's, but you've gone a step further and reduced the steps quite a lot.
My BASIC skills have now been advanced to BASIC-102 level.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.)
Please visit my Website at: http://oldendayskids.blogspot.com/
Please visit my Website at: http://oldendayskids.blogspot.com/