1. its
Senior Member
Join Date
Dec 1969
Posts
238

I have a Variable which is holding the value 2001 and i want to add 1 to that variable (2001 +1 = 2002). I am looking for some clue here...<BR><BR>MyVar = 2001<BR>I need add 1 to MyVar which will be 2002.

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

&nbsp;<BR>Dim MyVar<BR>Dim Total<BR><BR>MyVar = 2001<BR><BR>Total = Cint(MyVar) + 1<BR><BR>Response.Write Total<BR><BR><BR>Hope this helps!<BR>Sincerely<BR>Vlince

3. Senior Member
Join Date
Dec 1969
Posts
1,843

MyVar = 2001<BR>MyVar = CLng(MyVar) +1<BR><BR>You&#039;re doing CLng to convert your variable to a Long Integer.

4. Senior Member
Join Date
Dec 1969
Posts
2,092

## Yes...use Clng() instead of Cint()

Its a bad habit of mine ;-)

5. Senior Member
Join Date
Dec 1969
Posts
1,843

## But Remember:

(and this is mostly directed towards the original poster) <BR><BR>That cInt() has a limit of 32767. If there is any chance the number you are working with will be larger then then then you should use cLng. If you&#039;re working with a decimal you should use cDbl (for a double-precision number)

6. Senior Member
Join Date
Dec 1969
Posts
1,843

## I must have a stuttering problem

"be larger then then then you should"

#### Posting Permissions

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