Hi all,

Just quick question. In a sub/function  I've few parameters which I need to 
*set to Nothing* at the end of the function. I don't want to write like set 
myvar = Nothing for 10/20 times..

I tried the below code but the constrain is vbscript doesn't support the 
param array . So the below code doesn't work. Any thoughts

Dim oXMLHTTP

Dim vConn

oXMLHTTP = "abc"

vConn = "xyz"

SetToNothing (Array(oXMLHTTP,vConn)) 

msgbox oXMLHTTP

'''This Still showing the value of oXMLHTTP as "abc" which should not be

Function SetToNothing( parameters()) 
    Dim i
    On Error Resume Next 
    SetToNothing = True 
    For i = LBound(parameters) To UBound(parameters) 

        Set parameters(i) = Nothing 
        If Err.Number <> 0 Then SetToNothing = False 'if not object/variant 
variable
    Next 
End Function


Cheers
A



-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to