473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Quick question...

Hi all,

In the days of VB6, I used to add a module to my project that did nothing
but declare all of the variables I was going to use throughout the entire
application, just to keep everything together and a bit cleaner.

Are modules in VB.NET still available to be used like this or am I only able
to use variables locally to each class/form within the project?

TIA,
-Rich
Nov 20 '05 #1
7 945
Yes, modules still work that way.. .although I'd recommend making shared
properties out of them instead..but that's just a matter of preference.

HTH,

Bill
"Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi all,

In the days of VB6, I used to add a module to my project that did nothing
but declare all of the variables I was going to use throughout the entire
application, just to keep everything together and a bit cleaner.

Are modules in VB.NET still available to be used like this or am I only able to use variables locally to each class/form within the project?

TIA,
-Rich

Nov 20 '05 #2
* "Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> scripsit:
In the days of VB6, I used to add a module to my project that did nothing
but declare all of the variables I was going to use throughout the entire
application, just to keep everything together and a bit cleaner.

Are modules in VB.NET still available to be used like this or am I only able
to use variables locally to each class/form within the project?


"Project" -> "Add Module..."

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3
"Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
.. . .
. . . add a module to . . . declare all of the variables I was going to
use throughout the entire application


Rich,

Please, /please/, *please* tell me you don't actually mean that!

<flashback type="scary" image=" DATA DIVISION">

Global variables in an application of any size almost inevitably leads
to problems, unwanted side-effects and some real run-time horror
stories. The very thought of having /everything/ as Global just gives
me the Heebie-Jeebies... ;-)

Regards,
Phill W.
Nov 20 '05 #4
LOL, thanks for the wake up call Phil.

I'm still fairly new with VB altogether and I was never sent to any classes,
just kind of thrown in the deep end. There was a consultant here who did
that all the time and when he left, I took over his code so since that was
the first 'reference' to real-world code, that's what I picked up on. It
looked clean and being the neive new guy, I figured that was the way to do
it.

Anyrate, I appreciate the feedback on this, and I guess I'll keep an eye out
on finding the better path.

-Rich

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:bo**********@yarrow.open.ac.uk...
"Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
. . .
. . . add a module to . . . declare all of the variables I was going to
use throughout the entire application


Rich,

Please, /please/, *please* tell me you don't actually mean that!

<flashback type="scary" image=" DATA DIVISION">

Global variables in an application of any size almost inevitably leads
to problems, unwanted side-effects and some real run-time horror
stories. The very thought of having /everything/ as Global just gives
me the Heebie-Jeebies... ;-)

Regards,
Phill W.

Nov 20 '05 #5
Yes...

and never use "Blink" either...
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:bo**********@yarrow.open.ac.uk...
"Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
. . .
. . . add a module to . . . declare all of the variables I was going to
use throughout the entire application


Rich,

Please, /please/, *please* tell me you don't actually mean that!

<flashback type="scary" image=" DATA DIVISION">

Global variables in an application of any size almost inevitably leads
to problems, unwanted side-effects and some real run-time horror
stories. The very thought of having /everything/ as Global just gives
me the Heebie-Jeebies... ;-)

Regards,
Phill W.

Nov 20 '05 #6
I'll bite...what is "Blink"?

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vq************@corp.supernews.com...
Yes...

and never use "Blink" either...
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:bo**********@yarrow.open.ac.uk...
"Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
. . .
. . . add a module to . . . declare all of the variables I was going to use throughout the entire application


Rich,

Please, /please/, *please* tell me you don't actually mean that!

<flashback type="scary" image=" DATA DIVISION">

Global variables in an application of any size almost inevitably leads
to problems, unwanted side-effects and some real run-time horror
stories. The very thought of having /everything/ as Global just gives
me the Heebie-Jeebies... ;-)

Regards,
Phill W.


Nov 20 '05 #7
Never mind, got it.

Thanks again for the responses.

"Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> wrote in
message news:ut**************@TK2MSFTNGP09.phx.gbl...
I'll bite...what is "Blink"?

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vq************@corp.supernews.com...
Yes...

and never use "Blink" either...
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:bo**********@yarrow.open.ac.uk...
"Rich Wallace" <ri**********@minusthecannedmeat.jfsheadotcom> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
. . .
> . . . add a module to . . . declare all of the variables I was going to > use throughout the entire application

Rich,

Please, /please/, *please* tell me you don't actually mean that!

<flashback type="scary" image=" DATA DIVISION">

Global variables in an application of any size almost inevitably leads
to problems, unwanted side-effects and some real run-time horror
stories. The very thought of having /everything/ as Global just gives
me the Heebie-Jeebies... ;-)

Regards,
Phill W.



Nov 20 '05 #8

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

Similar topics

1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

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.