"Rob" <ro***@yahoo.co mwrote in message
news:As******** *************** *******@comcast .com...
Thanks for all the input folks....
This is a windows app, not a web app.
Here is why I want to use a global variable....
I simply want to put the name and version of the program in the text
property of every form. If I have 15 forms in a program, then I must
remember to change it in the Load of every form. How best would I
accomplish this ? I chose not to start out with a module, because if I
do, some of the startup properties must be changed (like single instance
app - which I want to keep selected).
The proper way to to this would be to have a Help About Menu option. If you
go to any Windows Desktop application on your machine like Word, Excel or
any desktop application of that nature, you will see the Help with an About
where this information is keep.
That's kind of a standard that is used. One doesn't put this information on
every form. You should be able to use Google and find out how to format an
Help About, even if you have to go back to a VB 6 example.
Maybe, you can find a book or an article about the guidelines for Windows UI
design.
http://www.google.com/search?hl=en&q...es&btnG=Search
>
I feel like I am going to get bashed bad for this, but here goes...
Why are public variables so offensive ? Does it all have to do with
security (maybe use a constant instead) ? Are they just as bad as using
Public properties ? While we are on the topic, what is the BEST way to
pass variable between forms ?
You should try to keep the scope of a varibale *local* as much as possible,
IMHO. I am sure you can find pros and cons of global vs local variable
usage.
http://www.softwareacademy.de/cppler...0Local%20Scope
There is nothing stopping you from passing variables in a form's constructor
like any other class to keep the Local scope on variables.
http://www.internetcross.com/display/62.php
There is nothing worst than trying to find out the reasons for a Global
variable and its intended usage as a developer just flat-out becomes lazy
with the usage, and they are all over the place with different meanings
sometimes with re-use them for a different reason along the way. :)
IMHO, if you need Gobal variables or even functions at times, then put them
in a public object.