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
If you don't explicitly set the return type then it is considered to be string. The compiler will convert the number to string and back to a number for you. However it is better to correctly set the type instead.