A handy pattern that I like to use:
TryGetBlah(ByRef blah as BlahType) as Boolean
It kills two birds with one stone.
Test that blah exists
Gets blah
What I don't like is that when reading the function body, it is easy to forget that the ByRef parameter is an output. I've started suffixing Out to the parameter to make it clear that the value is an output.
TryGetBlah(ByRef blahOut as BlahType) as Boolean
But, the suffixing feels funny to me, this is because I don't like naming my parameters technically like this. It reminds me of Hungarian notation.
blah
will get set if it is set-able and true will be returned. Otherwise blah will not be set and false will be returned. Look at Integer.TryParse for example: Public Shared Function TryParse (s As String, ByRef result As Integer) As Boolean – Patrick Te Tau Aug 31 '11 at 21:51