[AccessD] Global Variable

DWUTKA at marlow.com DWUTKA at marlow.com
Wed May 18 11:41:03 CDT 2005


And what is the good reason to use an Integer?

Drew

-----Original Message-----
From: Susan Harkins [mailto:ssharkins at bellsouth.net]
Sent: Wednesday, May 18, 2005 8:01 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Global Variable


Not to mention that the data type is the first step to validating your data
-- if Integer isn't large enough, the data's wrong -- there's a very good
reason TO use Integer. 

Susan H. 

<< Declaring a variables an Integer IS bad practice.  It is bad practice
because even if you think a variable will never go over 32k, or below -32k,
it can, and probably will.

Question: So when will the following declaration exceed the 32k, -32k limit?

Dim intFamilyMembers as integer 'Number of immediate family members

Answer: When you declare the variable as a Public (global) variable, then
some other function written by some other developer changes its intended use
causing the original function to possibly work incorrectly.


-- 
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