Inspection Details

UntypedFunctionUsage


Summary
Flags uses of a number of specific string-centric but Variant-returning functions in various standard library modules.
Reasoning
Several functions in the standard library take a Variant parameter and return a Variant result, but an equivalent string-returning function taking a string parameter exists and should probably be preferred.
The following code example(s) would trigger this inspection:

Public Sub DoSomething(ByVal foo As Double)
    Debug.Print Format(foo, "Currency") ' Strings.Format function returns a Variant.
End Sub

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

Public Sub DoSomething(ByVal foo As Double)
    Debug.Print Format$(CStr(foo), "Currency") ' Strings.Format$ function returns a String.
End Sub


Back to List