[thelist] ASP: DIM var AS ??

Chris W. Parker cparker at swatgear.com
Wed Jul 2 18:56:37 CDT 2003


Paul Cowan <mailto:evolt at funkwit.com> wrote:

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

SORRY! ;P

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

I see, I see.

I've never thought about this so I guess I'm one of the developers "who think, 'aah, that number will never get as high as 32,000'".

But still CLng() has a limit doesn't it? Granted it's much higher than CInt(), but still you're not ultimately protecting from that variable having an overflow since CLng() has a limit as well correct?

Ultimately how do you protect from an overflow? Can you test the size of the variable and truncate it if it's too big?



Chris.


More information about the thelist mailing list