In VB.NET on a boolean function if you run an Exit Function line will it return false?
+1
A:
As long as you have not set that function to True before you exit
kevchadders
2009-04-03 14:44:46
+5
A:
That is correct, with the caveat that in VB the function name can also be a variable that is returned. If you've previously set that to true, it will return true.
Joel Coehoorn
2009-04-03 14:44:59
Possibly this is a matter of clarity, but this works in VB because that function output variable is init'd to false and without an explicit return it's that variable which is returned
annakata
2009-04-03 15:03:58
+2
A:
Regardless if it does or not (the compiler gives a null-reference warning only), you should still explicitly return false, if only for readability.
hmcclungiii
2009-04-03 18:53:10
A:
I always do "Return True" or "Return False" to exit a method instead of the exit statement.
Rick Ratayczak
2009-04-04 10:58:56