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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Variables not working properly

Status
Not open for further replies.

Ken100

Programmer
Oct 29, 2007
6
US
Hi

I am using Application Variables for popping up a survey window for every 10th user. But my application variables
not giving proper count.Suppose I refresh the page it should increase the count by 1. Some times after 3 it shows
5 and after that 1 and like that no proper order.
Here is the code I wrote.
I have checked whether any other users are using the same
page at a time, But chances are very very less.
*************************
Application("SERVICE_COUNT") = Application("SERVICE_COUNT")
if Application("SERVICE_COUNT") = "" then
Application("SERVICE_COUNT") = 0
end if
Response.Write ("APPLICATION HOME PAGE COUNT : " & Application("SERVICE_COUNT"))
dim reminder
reminder = Application("SERVICE_COUNT") mod 10 '//Getting 10th user
if ( reminder = 0 ) then
Response.Write (" ; REMINDER COUNT : " & reminder)

end if
if Application("SERVICE_COUNT") >= 10 then
Application("SERVICE_COUNT") = 0
end if
Application("SERVICE_COUNT") = Application("SERVICE_COUNT") + 1
Application.UnLock
%>

Its working fine on our Development server.
But I am having problems staging server.

Any help will be appreciated.
 
What is that first line of code supposed to do?[tt]
Application("SERVICE_COUNT") = Application("SERVICE_COUNT")
[/tt]


Isn't that like the following: [tt]
x = x[/tt]

Maybe I was overlooking something
 
I am declaring the Application Variable
Application("SERVICE_COUNT") = Application("SERVICE_COUNT")

So that the application Variable wont be null
 
So it means something rather than nothing.
 
Yes you are right.
Any idea whether my coding is right or wrong ???
 
Not sure, so to speak, if it starts out Empty rather than Null. Let's make it Null for definiteness.
[tt]
z=null
z=z
response.write typename(z)
[/tt]
Would the z become something?
 
[tt]if Application("SERVICE_COUNT") = "" then
Application("SERVICE_COUNT") = 0
end if
Response.Write ("APPLICATION HOME PAGE COUNT : " & Application("SERVICE_COUNT"))
dim reminder
reminder = cint(Application("SERVICE_COUNT")) mod 10 '//Getting 10th user
if ( reminder = 0 ) then
Response.Write (" ; REMINDER COUNT : " & reminder)
end if
'these are really not needed, besides it is at wrong place
'if cint(Application("SERVICE_COUNT")) >= 10 then
' Application("SERVICE_COUNT") = 0
'end if
Application("SERVICE_COUNT") = (cint(Application("SERVICE_COUNT")) + 1) mod 10
Application.UnLock
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top