Android Question Warning #3 in a Sub

Massy

Member
Licensed User
Longtime User
I have this Sub I found in the forum that makes me find the number of days passed between 2 dates:

B4X:
Sub DaysBetweenDates(Date1 As Long, Date2 As Long)
  Return Floor((Date2 - Date1) / DateTime.TicksPerDay)
End Sub

it works all fine but I get a warning: "Return type (in Sub signature) should be set explicitly. (warning #3)"
Anyone knows what is it about and how to fix it?
Thanks for any help
Massy
 

NJDude

Expert
Licensed User
Longtime User
You can ignore that, if you like you can change the signature of that sub like this:
B4X:
Sub DaysBetweenDates(Date1 As Long, Date2 As Long) As Double
or just prevent that warning for showing by doing this:
B4X:
Sub DaysBetweenDates(Date1 As Long, Date2 As Long) 'ignore
 
Last edited:
Upvote 0
Top