So you know how PHP internal functions usually return a boolean FALSE when a function fails, or some other data type when the function succeeds? Is this possible in VB .Net?
For instance, lets say this simple code here
Public Function TrySomething(ByVal Param As String) \\what would go here??
If Param <> "MAGICWORD" Then
Return False
Else
Return "You Win!"
End If
End Function
You see I want to return a BOOLEAN false when a function fails, and a string when the function works. Any ideas? I’ve looked everywhere, and when I search for “return multiple types” all I find is Tuple.
This will Work for you:
You can check the values like this: