TheProgrammingZone
TheProgrammingZone.com
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 05, 2012, 01:44:02 am

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


View Profile
« 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
« 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
« 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 SMF 1.1.16 | SMF © 2011, Simple Machines
TheProgrammingZone 2010
Site Map