Scope of variables declared in .vb module files

  • Thread starter Thread starter Anand Sagar
  • Start date Start date
A

Anand Sagar

If I declare a variable in a .vb module file , like
Public Module modMain
Public temp As String
End Module


I am able to access the variable temp in all the pages of my site. However,
I want to know if the variable temp above is a variable of session scope or
application scope.

Does anyone know ?


Thanks
Anand Sagar
(e-mail address removed)
 
Anand Sagar said:
If I declare a variable in a .vb module file , like
Public Module modMain
Public temp As String
End Module


I am able to access the variable temp in all the pages of my site. However,
I want to know if the variable temp above is a variable of session scope or
application scope.

Does anyone know ?

It's of application-wide scope, and probably requires synchronization code
if you're ever going to modify it.

My preference is to never use modules, but to use public classes instead.
Modules are a part of VB from before the days when it supported
object-orientation.
 
Thanks, That was a real quick answer.
;)


John Saunders said:
It's of application-wide scope, and probably requires synchronization code
if you're ever going to modify it.

My preference is to never use modules, but to use public classes instead.
Modules are a part of VB from before the days when it supported
object-orientation.
 
Back
Top