Overflow: 'CInt' ????

# Thread: Overflow: 'CInt' ????

1. Senior Member
Join Date
Dec 1969
Posts
433

## Overflow: 'CInt' ????

Hi,<BR><BR>Trying to convert a querystring to an integer.<BR>The string is definately only numbers, no other characters, this is proved using a reponse write and looking at the address at the top of the page.<BR><BR>Code I am using is:<BR><BR>IF Len(Request.Querystring("event")) &#062; 0 THEN<BR>eventnumber = Trim(Request.Querystring("event"))<BR>Session("eve ntnumber") = CInt(eventnumber)<BR><BR><BR>This results in a Overflow: &#039;CInt&#039; error.<BR><BR>Anyone had this? It&#039;s been stumping me for ages now!<BR><BR>An eventnumber will looks something like this: 33672<BR><BR>HELP!<BR>

2. Senior Member
Join Date
Dec 1969
Posts
2,225

## try Clng <eop>

.

3. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## 32767 is the maximum value..

... that an Integer can be.<BR><BR>You should always use CLng() or CDbl() if you need decimals.

4. Senior Member
Join Date
Dec 1969
Posts
433

## What is a CIng?

It gives me a type missmatch error whatever it is...

5. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Basically same as CInt()..

Except, it converts to a Long instead of an Integer.

6. Senior Member
Join Date
Dec 1969
Posts
433

## RE: 32767 is the maximum value..

.

7. Senior Member
Join Date
Dec 1969
Posts
433

## Sorry, missread it.... <eop>

.

8. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Really??

so <BR><BR>cint == cing??<BR><BR><BR>hmmmmm......very interesting??<BR><BR><BR>hehehe<BR><BR>

9. Senior Member
Join Date
Dec 1969
Posts
96,118

## And -32768 is minimum

For CLNG, the range is -2,147,483,648 to +2,147,483,647

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•