[thelist] ASP: DIM var AS ??

Paul Cowan evolt at funkwit.com
Wed Jul 2 18:15:06 CDT 2003

Chris W Parker wrote:
> The function you are looking for is called CInt().


No, the function he's looking for is called CLng().

CInt() works fine, until the number you're CInt()ing hits 32,768; once
it does, you'll get an overflow.

Developers who think "aah, that number will never get as high as 32,000,
I'll just use CInt()" have caused us such grief over the years (the
overflow happening, of course, AFTER the developer in question has long
since left) that not only have we banned CInt() altogether in our coding
standards, but we've got a custom SourceSafe plugin which (among other 
things) refuses to allow checkin of code which contains "CInt(".

Trust me, use CLng() -- your successors will thank you for it.

This has been a Cowan Service Announcement.


More information about the thelist mailing list