[AccessD] Global Variable

DWUTKA at marlow.com DWUTKA at marlow.com
Mon May 16 13:43:06 CDT 2005


I concur.  I still don't understand this 'bad practice' issue when it's
something that had no inherent issues.  Globals do EXACTLY what they are
supposed to do.  No more, no less.  There is no performance hit for them, if
they are what you need.  Obviously, if you use a Global, when you only need
a procedural, then it's just bad coding, and that would be 'bad practice',
but using them when you need a variable throughout your project is just
fine, and actually necessary.  Defining a variable as an Integer, now THAT's
bad practice.

Drew

-----Original Message-----
From: Gustav Brock [mailto:Gustav at cactus.dk]
Sent: Monday, May 16, 2005 11:34 AM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Global Variable


Hi John

You may like or prefer or need, or not, a global variable - that's up
to everyone to decide for him/herself - but they are not "bad practice",
not even in general. You may write clumsy code using globals, but not
using them gives no guarantee for nice code.

/gustav

>>> jwcolby at colbyconsulting.com 05/16 5:00 pm >>>
To dimension a global variable just go to the header of any module and
type
in 

Global MyVar as SomeVarType

That's all there is to it, you can now reference the variable from any
code
in the project.  Don't get carried away with them, they are considered
bad
practice in general.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/ 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Joe Rojas
Sent: Monday, May 16, 2005 10:54 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Global Variable


Hi All,

I am using a code example, from Microsoft, that allows me to print a
constant number of lines on a report. The code example uses a variable
that
is defined as Global. "Global TotCount As Integer"

What's the deal with Global? I can't find it defined anywhere.

TIA!
JR

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list