Use the Return keyword without any return values. I'm not quite certain if a False or Null will be returned, tho...
B4X:
Sub GetMsg_MessageReceived(From As String,Body As String) As Boolean
'
' do some stuff
'
' return true to eat the msg
'
Return True
'
' simply exit the sub
'
Return
End Sub
A Sub always returns a value even if it does not have an explicit "Return" statement. In the case of an "As Boolean" Sub the return can only be True or False. In the absence of an explicit "Return", or if the "Return" statement does not specify a value, the value of the returned value defaults to False.
The "Not all return paths return a value" is only a warning, the code will still compile and run and the return value will be False for those paths missing an explicit "Return somevalue" statement.