tags:

views:

533

answers:

4

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
+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
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
+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
A: 

I always do "Return True" or "Return False" to exit a method instead of the exit statement.

Rick Ratayczak