The object I’m working on is instantiated in JavaScript, but used in VBScript. In one code path, the variable M.DOM.IPt is defined and has a value, in the other however it is not. I need to detect if it has been defined or not. I checked that M.DOM is defined and accessable in both code paths. Every test I have tried simply results in this error:
Error: Object doesn’t support this property or method
I have tried:
IsEmpty(M.DOM.IPt)M.DOM.IPt is NothingisNull(M.DOM.IPt)
Is there any way to detect the variable isn’t defined and avoid the error?
Note: I can put On Error Resume Next in and it will simply ignore the error, but I actually need to detect it and conditionally do something about it.
Function SupportsMember(object, memberName) On Error Resume Next Dim x Eval('x = object.'+memberName) If Err = 438 Then SupportsMember = False Else SupportsMember = True End If On Error Goto 0 'clears error End Function