Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Repeating mouse check
#5
(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.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
Repeating mouse check - by PhilOfPerth - 07-24-2024, 03:50 AM
RE: Repeating mouse check - by DSMan195276 - 07-24-2024, 05:03 AM
RE: Repeating mouse check - by PhilOfPerth - 07-24-2024, 05:47 AM
RE: Repeating mouse check - by Pete - 07-24-2024, 09:08 PM
RE: Repeating mouse check - by PhilOfPerth - 07-24-2024, 11:26 PM



Users browsing this thread: 1 Guest(s)