VBSCRIPT and ASP : how to test that an Session Object is equal to nothing ? 
Author Message
 VBSCRIPT and ASP : how to test that an Session Object is equal to nothing ?

Hello,
I store in a Session Variable a reference of an Active Server Component.
After when i finished to use it, i set the session variable to nothing.
But after i don't know how to know that this variable is set to nothing...
I try to use the IsObject function and IsNull function but it's not the good
stuff...
i can in last try test the error with on error goto next, but if you have a
better solution
it's greater...
Thanks a lot to reply me...

PS : what i do...

set Session.variable("var1") = server.createobject("xxxx")
.......
' i free the object....
set session.variable("var1") = nothing
' after i want to re-use this object...
set myObject = session.variable("var1")
if isobject(myobject) then
    'in this case myobject = nothing but it is an object !!!!!
    ' how to to test that myobject = nothing ???????
else
    ' error
end if



Mon, 10 Sep 2001 03:00:00 GMT  
 VBSCRIPT and ASP : how to test that an Session Object is equal to nothing ?
i found the answer by myself....
you have to test like that :

if myobject is nothing then
else
end if

why VBScript is not orthogonal ?
Isobject()
Isnull()
Is...

Thanks

Dominique LE ROUX a crit dans le message ...

Quote:
>Hello,
>I store in a Session Variable a reference of an Active Server Component.
>After when i finished to use it, i set the session variable to nothing.
>But after i don't know how to know that this variable is set to nothing...
>I try to use the IsObject function and IsNull function but it's not the
good
>stuff...
>i can in last try test the error with on error goto next, but if you have a
>better solution
>it's greater...
>Thanks a lot to reply me...

>PS : what i do...

>set Session.variable("var1") = server.createobject("xxxx")
>.......
>' i free the object....
>set session.variable("var1") = nothing
>' after i want to re-use this object...
>set myObject = session.variable("var1")
>if isobject(myobject) then
>    'in this case myobject = nothing but it is an object !!!!!
>    ' how to to test that myobject = nothing ???????
>else
>    ' error
>end if



Mon, 10 Sep 2001 03:00:00 GMT  
 VBSCRIPT and ASP : how to test that an Session Object is equal to nothing ?
    Are you try to write
If session(..) = "" then

....
End if

\Diego

Quote:

>Hello,
>I store in a Session Variable a reference of an Active Server Component.
>After when i finished to use it, i set the session variable to nothing.
>But after i don't know how to know that this variable is set to nothing...
>I try to use the IsObject function and IsNull function but it's not the
good
>stuff...
>i can in last try test the error with on error goto next, but if you have a
>better solution
>it's greater...
>Thanks a lot to reply me...

>PS : what i do...

>set Session.variable("var1") = server.createobject("xxxx")
>.......
>' i free the object....
>set session.variable("var1") = nothing
>' after i want to re-use this object...
>set myObject = session.variable("var1")
>if isobject(myobject) then
>    'in this case myobject = nothing but it is an object !!!!!
>    ' how to to test that myobject = nothing ???????
>else
>    ' error
>end if



Mon, 24 Sep 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to test if an object equals nothing

2. How to test if an object equals nothing

3. Testing an Object equal to Nothing

4. VBSCRIPT and ASP : how to test that an Session Object is equal to nothing ?

5. ADO Connection Object Close and set it equal to nothing

6. Determining If An Object Is Equal To Nothing

7. Setting objects equal to Nothing-- when to do?

8. vbscript-objects and sessions in asp

9. Do visual basic and vbscript have equal access to the Office97/2000 object model

10. Testing nothing objects

11. Testing for object set to Nothing - Please help!

12. Testing whether object = nothing

 

 
Powered by phpBB® Forum Software