If you look carefully at the code you'll see that once it is:
X - startx
and in the second it is:
startx - X
X - startx is positive for a right swipe and negative for a left swipe
startx - X is positive for a left swipe and negative for a right swipe
This code works, I tested it before posting !
Private Sub pnlPage1_Touch(Action As Int, X As Float, Y As Float)
Select Action
Case pnlPage1.ACTION_DOWN
startx = X
starty = Y
Case pnlPage1.ACTION_MOVE
' Log("moving")
Case pnlPage1.ACTION_UP
If Abs(Y - starty) > 20%y Then Return
If X - startx > 20%x Then 'right
Log("Moved to the right")
Else If startx - X > 20%x Then ' left
Log("Moved to the left")
End If
End Select
End Sub
Logs:
Application_Start
Application_Active
Moved to the right
Moved to the left
Moved to the right
Moved to the left
Moved to the right