Inspection Details

FunctionReturnValueDiscarded


Try it in the latest pre-release build!
Summary
Warns when a user function's return value is not used at a call site.
Reasoning
A 'Function' procedure normally means its return value to be captured and consumed by the calling code.
Available quickfixes:
The following code example(s) would trigger this inspection:

Public Sub DoSomething()
    GetFoo ' return value is not captured
End Sub
Private Function GetFoo() As Long
    GetFoo = 42
End Function

The following code example(s) would not trigger this inspection:

Public Sub DoSomething()
    Dim foo As Long
    foo = GetFoo
End Sub
Private Function GetFoo() As Long
    GetFoo = 42
End Function


Back to List