[AccessD] Early Friday Untip

Charlotte Foust cfoust at infostatsystems.com
Tue May 4 10:31:50 CDT 2004


Well Val() is officially included for backward compatibility (I guess
they never mentioned that to the VB team <g>), and a lot of people
simply don't understand the issues of floating point errors.  They seem
to be under the impressions that you're safe if you stick to adding or
subtracting.  If you want to add another omission, CCur().

Charlotte Foust

-----Original Message-----
From: Gustav Brock [mailto:gustav at cactus.dk] 
Sent: Monday, May 03, 2004 11:22 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Early Friday Untip


Hi all

Just noticed this "untip" from Element K Journals".

Comments should not be necessary, but where did Val() and CLng() go? Why
not let a programmer proofread such tips?

<quote>

Beware of CInt; use CDbl instead (VB 6.0)

If you have any program that converts string values to numbers, 
you'll want to steer clear of the CInt function and use CDbl 
instead. The problem with CInt is that it only accepts numbers 
up to 32767. You might say today, "My number will never get that 
large." However, later on down the line, it might. 
Unfortunately, by that time, your code may be riddled with 
hundreds of CInt time bombs waiting to blow up, displaying the 
dreaded Overflow error. Using the CDbl function is no different 
from using CInt. The syntax is:

CDBl(numericstring)

CDbl returns the same value as CInt and it accepts num-bers up 
to 1.7976931348623158E+308.

</quote>


/gustav

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