VBScript has two syntaxes for setting a variable
Primitives such as String and Integer are set as
primitive_var = 3
While objects are set as
Set my_object = some_object
I have a function call that could return either. I can check for the type as follows
If VarType(f(x, y)) = vbObject Then
Set result = f(x, y)
Else
result = f(x, y)
End If
However this wastes a function call. How can I do this with only one call to f?