Click to See Complete Forum and Search --> : aplication("Ucount") may or maynot exist but
scragar
02-19-2004, 07:50 AM
how do I check if Application("Ucount") exist?
I've try several codes found on the net, but most either return an error or just don't work.
I would prefare to keep my coding in VBscipt if possible and please comment what you do for me to look at.
buntine
02-19-2004, 09:00 AM
Have you tried using ASP's library function isObject()?
scragar
02-19-2004, 09:39 AM
what's the exact santax? No I haven't tryd using it, I've not been informed of it's existance.
buntine
02-19-2004, 09:59 AM
Try this:
if not isObject(Application("Ucount")) = true then
response.write("Object doesnt exist")
else
response.write("Object does exist")
end if
scragar
02-20-2004, 05:06 AM
Why does this not work? it always return's you are the first visitor try here (http://cc.1asphost/scragar/test/index.asp)
remember I'm a noob at ASP, I only just started using it yesterday.
<%
Application.Lock
if not isObject(Application("Ucount")) = true then
Application("Ucount") = 1
Response.Write("you are the first visitor to my site")
else
Application("Ucount") = Application("UCount") + 1
Response.Write("the site has had " & Application("Ucount") & " visitors including yourself")
end if
Application.UnLock
%>
Please help.
EDIT:
I found out why, application runs out when all users close the page, this means once loaded the page will delete the application untill another user wants it when it's created again.
Sorry for wasteing everyones time.