Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Test if returned object is null - how?

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I am using VBScript to perform some simple XML DOM programming.

I'd basically like to know if there is any way of testing if an object returned from a function call is null?

For example, if I have the following pseudo code:
Dim theObject
Set theObject = xmldoc.selectSingleNode(XPath_string)
if theObject is null then
'do some code if the returned object is null
else
'continue as normal
end if

Are there any functions that test if the 'theObject' is null? I've tried isNull but it doesnt appear to work for objects.

Any help is appreciated, thankyou.

MrPeds
 
Try one of these:
If IsNull(expression) Then

If expression = "" Then

if len(expression) = 0 Then

if expression = nothing Then

if expression = Null Then

One of them should work for you

Dana Hallenbeck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top