Oops. Ignore my previous. I thought we were still on the Response.End
statement.
There is no "return" statement in vbscript. All statements in a procedure
will be executed until the statement that ends the procedure is executed,
unless an Exit <function|sub> statement is encountered.
So in this example "set someobj = nothing" will be executed. It's easy
enough to test this:
<%
dim globalvar
globalvar="initial value"
function changevar()
changevar = "I ran"
globalvar="new value"
end function
response.write changevar()
response.write "<BR>" & globalvar
%>
dotnettester wrote:
sorry, my question is, is it valid to close an object after the return
statement and would it work?
"dotnettester" wrote:
Hi,
I am maintaining some code and I see in some functions..
Function myFunction
set someobj = Server.CreateObject("MYOBJ")
....
...
set myFunction = "somedataToReturn"
set someobj = nothing
End Function
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"