Inspection Details

NonReturningFunction


Summary
Warns about 'Function' and 'Property Get' procedures whose return value is not assigned.
Reasoning
Both 'Function' and 'Property Get' accessors should always return something. Omitting the return assignment is likely a bug.
The following code example(s) would trigger this inspection:

Public Function GetFoo() As Long
    Dim foo As Long
    foo = 42
    'function will always return 0
End Function

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

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


Back to List