There's one more thing you have to be very careful of with VARTYPE.
Checking for compound objects may cause errors to occur with VARTYPE()
where TYPE() returns just "U". For example if you have an object
reference like:
VARTYPE(oObject.oSubObject.cValue)
and oSubObject is not an object VARTYPE will cause an error.
This is unfortunate, but expected since VARTYPE treats the expression, well as an expression that may fail. While non-existing single (non . vars) will generate "U" results, VARTYPE() will cause an error.
IOW, you can use VARTYPE() in this situation only if you know at
the very least that all objects actually exist and will return
some sort of type or NULL.