473,654 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scope of variables declared in .vb module files

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
ba******@yahoo. com
Nov 18 '05 #1
2 2760
"Anand Sagar" <ba*****@vermar .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #2
Thanks, That was a real quick answer.
;)
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:uJ******** *****@TK2MSFTNG P12.phx.gbl...
"Anand Sagar" <ba*****@vermar .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.
--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3387
by: Tom | last post by:
I'm tying myself in knots trying to figure out variable scope with constants and include files. This is what I'm doing: A page (index.php) on my website includes a general purpose include file (ini.inc) that declares a constant DAY_NUM. A little later in the file, ini.inc includes another file (b_data.inc) that tries to use DAY_NUM. I'm getting a "Use of Undefined Constant" notice as a result of this line when I load index.php in the...
6
3150
by: pembed2003 | last post by:
Hi all, I am reading the book "C++ How to Program" and in the chapter where it discuss scope rule, it says there are four scopes for a variable: function scope file scope block scope function-prototype scope I think(might be wrong):
5
2085
by: pembed2003 | last post by:
Hi all, I am reading the book "C How to Program" and in the chapter where it discuss scope rule, it says there are four scopes for a variable: function scope file scope block scope function-prototype scope I think(might be wrong):
2
1508
by: Ashish Shridharan | last post by:
Hi All I have been tryign to figure out the scope of a module as shown declared below in a web environment. My Questions are Is this module shared across multiple instances of the application ?? What about variables declared in global scope of this
7
1444
by: moondaddy | last post by:
I want to create a public enum that can be used throughout a project. I created an enum like this in a module: Public Enum ParentType Project = 0 Stage = 1 VIP = 2 Func = 3 Equipment = 4 Idea = 5
6
2149
by: Neelesh Bodas | last post by:
Hello All, I was just listing down various ways in which variables can be created and destroyed in C++. (On the lines of 10.4.3 TC++PL Ed 3) Putting the summary here for corrections, comments, criticism, advices, improvements. Abbreviation: Created (C)
1
25664
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause bad breath)? Scope describes the context in which a variable can be used. For example, if a variable's scope is a certain function, then that variable can only be used in that function. If you were to try to access that variable anywhere else in...
0
35212
MMcCarthy
by: MMcCarthy | last post by:
We often get questions on this site that refer to the scope of variables and where and how they are declared. This tutorial is intended to cover the basics of variable scope in VBA for MS Access. For the sake of brevity I am sticking to common usage. Wherever the term procedure is used in this tutorial it actually refers to a subroutine or function. Definition of Scope The scope of a variable where this variable can be seen or accessed...
3
2473
by: John Dann | last post by:
Trying to learn Python here, but getting tangled up with variable scope across functions, modules etc and associated problems. Can anyone advise please? Learning project is a GUI-based (wxPython) Python program that needs to access external data across a serial port. The first thing that I need the program to do when it starts up is to check that it can see the serial port, the first step of which is to check that it can import the...
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.