Help! How do I make a "between" character?

WhiteRussianBC

New Member
Licensed User
I need some help making a "between" character. Im making an application wich will do one thing when you press the right side of the form and another thing when you press the left side.

Heres what I tried:
(THE COORDINATES ARE NOT CORRECT IN THIS EXAMPLE)

B4X:
Sub Form1_MouseDown (x,y)
If x = 0 <> 80 Then
msgbox ("Left side")
Else if x = 80 <> 150 then
msgbox ("Right side")
End If
End Sub

And it doesen't work. Well, you see my problem. I need:
If x = between 0 to 80 Then...

Please help
 

agraham

Expert
Licensed User
Longtime User
Try something like
B4X:
Sub Form1_MouseDown (x,y)
  If x < 120 Then
   msgbox ("Left side")
  Else
    msgbox ("Right side")
  End If
End Sub
Or three zones

B4X:
Sub Form1_MouseDown (x,y)
  If x < 80 Then
    msgbox ("Left side")
  Else if x >= 80 AND x<160 then
    msgbox ("Middle")
  Else
    msgbox ("Right side")
  End If
End Sub
 

N1c0_ds

Active Member
Licensed User
Or you can set it with MouseUp. This way you can put visual feedback in the mousedown event (like show the "clicked" pictures) and actual actions in the mouseup event.
 
Top