[AccessD] Integer v. Long

Randall Anthony randall.anthony at cox.net
Mon Sep 5 09:12:37 CDT 2022


Got to agree with Rocky, too many times I have had to deal with a broke app
to find out it that it hit the 32K mark with ease.  I use Long just about
everywhere.

HTH.

-----Original Message-----
From: AccessD <accessd-bounces+randall.anthony=cox.net at databaseadvisors.com>
On Behalf Of Rocky Smolin
Sent: Monday, September 5, 2022 9:58 AM
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Integer v. Long

I usually only use Long if referencing a PK which could easily got of 32k.
Or working with record counts. Occasionally I'll have an app where an
integer could go over 32k - like weight in pounds of metals which can go to
several tons. However, my use of integer goes back to the 1960s when memory
was at  a premium. I also still name my temporary counters intI, intJ, etc.,
which goes back to Fortran where variables beginning with I,J,K,L,M, and N
were integers.

r

On Mon, Sep 5, 2022 at 1:15 AM Arthur Fuller <fuller.artful at gmail.com>
wrote:

> Frequently I encounter code (most often in samples but sometimes also 
> in examples, and even in code made available for public consumption) 
> in which the developer declares numeric variables as Long rather than as
Integer.
> This practice strikes me as a lazy habit.
>
> Data Type Low Range High Range Storage Requirement (bytes) Integer 
> -32,768 32,767 2 Long -2,147,483,648 2,147,483,647 4
>
> Granted, if storage and performance were critical, one would probably 
> not code in VBA. But for most practical purposes in VBA, it seems to 
> me that Longs are overkill.
>
> Opinions?
> --
> Arthur
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
AccessD mailing list
AccessD at databaseadvisors.com
https://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
This email has been checked for viruses by Avast antivirus software.
www.avast.com


More information about the AccessD mailing list