Re: Dim vs. Public

From: Harald Staff (stf_at_enron.invalid)
Date: 01/27/05


Date: Thu, 27 Jan 2005 12:50:14 +0100


"Jamie Collins" <jamiecollins@xsmail.com> skrev i melding
news:1106818462.360944.116730@z14g2000cwz.googlegroups.com...
> As far as I know there is no good reason for using a Public variable;
> I've never used one myself. If you need to share a module-level
> variable with another module, you can use a Property

Hi Jamie

Question of style, I think. I use public variables for things that are used
all over the app and that won't change "today" (=during the session).
Typically it's a username, a database address, environmental information, a
major choice in startup, ...

Best wishes Harald



Relevant Pages

  • Re: Page Break in Excel from VB 2005
    ... I'm going to start to move the public variables. ... The reason I did not have the spreadsheet visible is because this program is ... having invisible copies of excel running if the project errored out. ... programming) is that of encapsulation. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Page Break in Excel from VB 2005
    ... I'm going to start to move the public variables. ... The reason I did not have the spreadsheet visible is because this program is going to run a couple hundred times in a day and the time to open and close excel itself would be very time consuming. ... You mention a possible memory leak. ... The generate lines rountine has many sub routines. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to shut off ALL Menus ?
    ... There is no specific reason for a public variable to lost its value in these ... TextBoxes or TextBoxes on hidden forms instead of public variables. ... Since you need a hidden form for its Close/Unload event then you have a ...
    (comp.databases.ms-access)
  • Re: Form level Public Variables
    ... > Public variables. ... Let|Set" as wrapper for the variables. ... One reason is that your form is totally unaware of changes made from ... > Now to me creating a form level variable that will accept an indicator as to ...
    (microsoft.public.vb.enterprise)