Application variable vs. static variable

michael_hk

Centurion
Joined
Nov 24, 2003
Messages
199
Location
Hong Kong
Hi,

What is the difference between an application (scope) variable and a static variable (inside an object)? :confused: Seems they are shared by all web users.

Thanks.

Michael
 
For normal application variable, there are duplicated as many as user request. But for Static variable, there is only one shared by all the users.

For example, if I want to do a counter in my web page for today login user, I can simple define a static variable (called "staticCounter" for example), then in login function, I can simply put "staticCounter += 1", this variable will automatic increase base on user login. In this case if I use normal variable, this value always = 1
 
Back
Top