i am trying to use Class Slidingsidebar but the module gives this warning in the log
at this code
why this warning raised ?
Not all code paths Return value
at this code
B4X:
Private Sub CalcDistance(FromOpen As Boolean) As Int
' Calculates the distance between the current position and the position to reach
Select sbPosition
Case 0 'LEFT
If sbAnimType = 2 Then
If FromOpen Then
Return - pnlSidebar.Left
Else
Return - pnlSidebar.Left - pnlSidebar.Width
End If
Else
If FromOpen Then
Return pnlSidebar.Width - pnlContent.Left
Else
Return - pnlContent.Left
End If
End If
Case 1 'RIGHT
If sbAnimType = 2 Then
If FromOpen Then
Return - pnlSidebar.Left + pnlContent.Width - pnlSidebar.Width
Else
Return - pnlSidebar.Left + pnlContent.Width
End If
Else
If FromOpen Then
Return - pnlSidebar.Width - pnlContent.Left
Else
Return - pnlContent.Left
End If
End If
Case 2 'TOP
If sbAnimType = 2 Then
If FromOpen Then
Return - pnlSidebar.Top
Else
Return - pnlSidebar.Top - pnlSidebar.Height
End If
Else
If FromOpen Then
Return pnlSidebar.Height - pnlContent.Top
Else
Return - pnlContent.Top
End If
End If
Case 3 'BOTTOM
If sbAnimType = 2 Then
If FromOpen Then
Return - pnlSidebar.Top + pnlContent.Height - pnlSidebar.Height
Else
Return - pnlSidebar.Top + pnlContent.Height
End If
Else
If FromOpen Then
Return - pnlSidebar.Height - pnlContent.Top
Else
Return - pnlContent.Top
End If
End If
End Select
End Sub
why this warning raised ?