Hex => Decimal 
Author Message
 Hex => Decimal


Quote:
> how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

Use Val(), like this:

    sHex = "123ABC"
    nHexValue = Val("&H" & sHex)

    Debug.Print sHex; " = "; nHexValue

--

http://www.*-*-*.com/
Sample code and utilities.



Wed, 04 Sep 2002 03:00:00 GMT  
 Hex => Decimal
Don't use Val -- use CLng instead (Nikolai -- everything else is the same).
Try yours with sHex = "FFFF" and tell me that is the result you wanted. CLng
doesn't suffer from that conversion problem.

Rick


Quote:


> > how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

> Use Val(), like this:

>     sHex = "123ABC"
>     nHexValue = Val("&H" & sHex)

>     Debug.Print sHex; " = "; nHexValue

> --

> http://www.scottandmichelle.net/scott/code/
> Sample code and utilities.



Wed, 04 Sep 2002 03:00:00 GMT  
 Hex => Decimal
Official link: http://go.to/game-player
Direct link: http://home.sol.no/~thomashj/Game-Player/files/index.html

Full source of a program i made that convert's hex to dec
dec to hex, and more... The program is called "Password-Creator"



Quote:
> Don't use Val -- use CLng instead (Nikolai -- everything else is the
same).
> Try yours with sHex = "FFFF" and tell me that is the result you wanted.
CLng
> doesn't suffer from that conversion problem.

> Rick





> > > how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

> > Use Val(), like this:

> >     sHex = "123ABC"
> >     nHexValue = Val("&H" & sHex)

> >     Debug.Print sHex; " = "; nHexValue

> > --

> > http://www.scottandmichelle.net/scott/code/
> > Sample code and utilities.



Wed, 04 Sep 2002 03:00:00 GMT  
 Hex => Decimal
Hello,

how can I convert a Hexadecimal String (#80FF80#) to a Long Value?



Thu, 05 Sep 2002 03:00:00 GMT  
 Hex => Decimal
the Val() function returns a double, not a long

Mr. X


Quote:


> > how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

> Use Val(), like this:

>     sHex = "123ABC"
>     nHexValue = Val("&H" & sHex)

>     Debug.Print sHex; " = "; nHexValue

> --

> http://www.scottandmichelle.net/scott/code/
> Sample code and utilities.



Thu, 05 Sep 2002 03:00:00 GMT  
 Hex => Decimal
I don't know an easy way to convert it, but you can assign it as
follows:

Dim Var As Long
Var = &H80FF80
debug.print Var
Text1.Text = format(Var)

Good Luck,
G.Doucet

Quote:

> Hello,

> how can I convert a Hexadecimal String (#80FF80#) to a Long Value?



Thu, 05 Sep 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. HEX -> DECIMAL Conversion ?????

2. HEX -> decimal code?

3. Hex <----> Decimal conversions

4. Hex->Decimal

5. hex string -> hex number

6. HEX >> DEC

7. hex to decimal

8. INPUTing Decimal, PUTting Hex

9. Converting Hex to Decimal

10. Converting Hex to Decimal

11. Hex to Decimal - Urgent

12. Convert HEX to decimal?

 

 
Powered by phpBB® Forum Software