TheProgrammingZone
TheProgrammingZone.com
Welcome, Guest. Please login or register.
January 06, 2009, 04:51:17 am

Login with username, password and session length
Search:     Advanced search
Welcome to the TheProgrammingZone.com forums.
217 Posts in 83 Topics by 758 Members
Latest Member: joomlanews
* Home Help Search Staff List Login Register
Sponsored Links
+  TheProgrammingZone.com
|-+  Programming
| |-+  Visual Basic (5/6)
| | |-+  Hexadecimal to Decimal conversion
« previous next »
Pages: [1] Print
Author Topic: Hexadecimal to Decimal conversion  (Read 1306 times)
Intrigue
Novice
**
Posts: 23


View Profile Email
Hexadecimal to Decimal conversion
« on: December 20, 2005, 05:49:03 am »

Another thing that the MSDN library wasn't too clear on when I searched; after scouring the Internet and rejecting the huge functions, I found this very easy method:

dec=val("&h" & hex)

I tried a similar approach, but managed to forget to add the "&h" first!

Intrigue
Logged
sarge
Newbie
*
Posts: 14


View Profile WWW Email
Re: Hexadecimal to Decimal conversion
« Reply #1 on: December 27, 2005, 02:58:18 pm »

dim x as double
x = val("&hFFFFFFFF)

X should be 4294967295, but it's calculated as -1.  This is a problem with the HEX function, it won't work over 7FFFFFFF.  Even adding the "&" at the end doesn't force a 32 bit calculation, even if the variable will hold a 64 bit number.

Sarge
Logged
Intrigue
Novice
**
Posts: 23


View Profile Email
Re: Hexadecimal to Decimal conversion
« Reply #2 on: December 27, 2005, 04:28:21 pm »

Thanks Sarge, nice to know someone's still alive after Christmas!

Intrigue
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP TheProgrammingZone.com | Powered by SMF 1.0.15.
© 2005, Simple Machines LLC. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!
Seo urls funded by a mortgage broker | implemented by the treo smartphone guy.
© 2006, SMFSEO.org. All Rights Reserved.
TheProgrammingZone 2007
Site Map