Here's how to do _MouseInput without While...Wend but just a GOTO. A one liner like While _MouseInput :Wend and without double parking (2 statements separated with colon).
EDIT: No sooner had I posted this when I realized the 2nd GOTO was not needed. Cool!
Looks like TempodiBasic was kinda close ;-))
Code: (Select All)
_Title "Click to draw paths from one click to next" 'b+ 2023-01-03
Do
10 If Not _MouseInput Then GoTo 10
mx = _MouseX: my = _MouseY: mb = _MouseButton(1)
If mb Then
If lastx <> 0 And lasty <> 0 Then
Locate my, mx: Print "X";
If mx > lastx Then
While lastx < mx
lastx = lastx + 1
Locate lasty, lastx: Print "X";
Wend
Else
While lastx > mx
lastx = lastx - 1
Locate lasty, lastx: Print "X";
Wend
End If
If my > lasty Then
While lasty < my
lasty = lasty + 1
Locate lasty, lastx: Print "X";
Wend
Else
While lasty > my
lasty = lasty - 1
Locate lasty, lastx: Print "X";
Wend
End If
End If
lastx = mx: lasty = my
End If
Loop
EDIT: No sooner had I posted this when I realized the 2nd GOTO was not needed. Cool!
Looks like TempodiBasic was kinda close ;-))
b = b + ...