This request is syntaxical sugar to prevent NULL assignements to objects.
Requested syntax:
SomeFunctionThatCanReturnNull(params) WhenNull ToAssignWhenResultIsNull(otherParams)
This should translate to:
Dim _res = Function(params, otherParams)
Dim _tmp = SomeFunctionThatCanReturnNull(params)
If _tmp Is Null Then
_tmp = ToAssignWhenResultIsNull(otherparams)
End If
End Function
So the code:
Dim a = SomeFunctionThatCanReturnNull(params) WhenNull ToAssignWhenResultIsNull(otherparams)
Translates to:
Dim _res = Function(params, otherparams)
Dim _tmp = SomeFunctionThatCanReturnNull(params)
If _tmp Is Null Then
_tmp = ToAssignWhenResultIsNull(otherparams)
End If
End Function
Dim a = res(params, otherparams)
And the code
If a = SomeFunctionThatCanReturnNull(params) WhenNull ToAssignWhenResultIsNull(otherparams) Then
Translates to:
Dim _res = Function(params, otherparams)
Dim _tmp = SomeFunctionThatCanReturnNull(params)
If _tmp Is Null Then
_tmp = ToAssignWhenResultIsNull(otherparams)
End If
End Function
If a = _res(params, otherparams) Then