In Visual Basic 6, is there anyway to tell if a variable passed into a function is an object?
I want to be able to test if the variable is null, nothing or empty but only objects can be tested using “Is Nothing”.
Any ideas?
In Visual Basic 6, is there anyway to tell if a variable passed into
Share
How is the function defined?
If it’s
... As Objectthen it’s either a valid object orNull.If it’s
... As Variant(or no type) then anything can be passed and you can check usingIsEmpty(),IsNull()(Note, NOT a null object, but a null value) orIsObject()depending on what exactly you want to check for before the... Is Nothingcheck.If the parameter is
Optionalthen you can useIsMissing()but it must be a variant type with no default value.Also, check out this article on the various uses of Null in VB.