[AccessD] explicit type

Stuart McLachlan stuart at lexacorp.com.pg
Thu Oct 2 04:39:18 CDT 2003


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.





More information about the AccessD mailing list