[AccessD] explicit type

Charlotte Foust cfoust at infostatsystems.com
Thu Oct 2 10:48:14 CDT 2003


I generally type my constants, but I think it is unusual in printed code
for the same reason that error handling is often left out.  Since
constants can't be changed, it doesn't seem terribly wrong to skip
typing them.

Charlotte Foust

-----Original Message-----
From: John B. [mailto:john at winhaven.net] 
Sent: Thursday, October 02, 2003 6:51 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] explicit type


Stuart,
Thanks, I can't even remember what my issue was now, wrote that a 2:00
AM...

I ran FMS Analyzer on an app and found that none of my constants have
ever been explicitly typed - even those from procedures I obtained from
other people, ADH, etc. Maybe that was the issue: Why don't they do it
why?

JB

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Stuart 
> McLachlan
> Sent: Thursday, October 02, 2003 4:39 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] explicit type
>
>
> On 2 Oct 2003 at 1:56, John B. wrote:
>
> > Just cleaning some code and I was wondering how much difference
> is it going
> > to make if I declare this:
> > Const conPropNotFoundError = 3270
> > If Err = conPropNotFoundError Then...
> > versus this:
> > Const conPropNotFoundError as Long = 3270
> > If Err = conPropNotFoundError Then...
> >
>
> If you don't declare it explicitly, it will be declared as a Variant 
> with all of the overhead of storing/interpreting variants.
>
> How much depends on how you are using it. The more you use the 
> constant, the more overhead you incur.  As a general rule -  declare 
> all variables and constants as the most efficient data type for its 
> purpose and only use variants if they are unavoidable.
>
>
>
>
>
>
>
>
> --
> Lexacorp Ltd
> http://www.lexacorp.com.pg
> Information Technology Consultancy, Software Development,System 
> Support.
>
>
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>


_______________________________________________
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