reversing int

1. Member
Join Date
Dec 1969
Posts
74

## reversing int

What is right way to reverse int?<BR><BR>I have something like this:<BR><BR>wholenumber="1344215523"<BR><BR>and I need to reverse it -&#062; newnumber="3255124431"

2. Senior Member
Join Date
Dec 1969
Posts
10,852

## Hmmm....

How about...<BR><BR>wholenumber = "1344215523"<BR>newnumber = StrReverse(wholenumber)<BR><BR>And then, if you need it in integer form...<BR><BR>CInt(newnumber)<BR>

3. Senior Member
Join Date
Dec 1969
Posts
10,852

## Crap.

I just realized...That with the number shown, the lost lone won&#039;t work. It&#039;ll cause an overflow.<BR><BR>you&#039;d need to do a CLng(newnumber).<BR><BR>*Sigh*....That&#039;s what I get, for being up this late, tryin&#039; to think.

4. Member
Join Date
Dec 1969
Posts
74

## RE: Hmmm....

I get some error:<BR><BR>Microsoft VBScript runtime error &#039;800a0006&#039; <BR><BR>Overflow: &#039;CInt&#039; <BR><BR>

5. Senior Member
Join Date
Dec 1969
Posts
10,852

## He he....

I beat you to the punch on that one...And I didn&#039;t even have to compile it to figure it out. ;-)<BR><BR>Anyway, my other post covers that eventuality.

6. Senior Member
Join Date
Dec 1969
Posts
10,852

## *Sigh*...OK, wait....

That number is too big for even CLng to handle.<BR><BR>Here ya go....And this one I know works....<BR><BR><BR>Int(newnumber)

7. Member
Join Date
Dec 1969
Posts
74

## RE: Crap.

I need to have to piece of that kokourli (999 and 12345) and this is what I got:<BR><BR>kokourli="12312312312345999"<BR><BR>ur lihash=right(kokourli, 3) <BR>&#039;999<BR>tokakokourli = StrReverse(kokourli)<BR>CLng(tokakokourli)<BR>urli uuid=mid(tokakokourli, 5, 3)<BR>&#039;should give number 12345<BR><BR>I tried to do this but if there is some other way, I would be glad to know that

8. Member
Join Date
Dec 1969
Posts
74

## Fast :)

Omg, you are fast typer :D

9. Senior Member
Join Date
Dec 1969
Posts
10,852

## LOL...What can I say....

When I get going, I get going. So...You got it figured out?<BR><BR>I see that you have commented out that you think urliuuid should equal 12345? When really it equals 432.<BR><BR><BR>Anyway, let us know if you need more help.

#### Posting Permissions

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