|
-
Jun 20th, 2003, 08:14 AM
#1
Thread Starter
Addicted Member
Hex to decimal [RESOLVED]
Can anyone help me please?
I am trying to convert a Hex value into an decimal, i am using a variable so i cannot use:
is there a quick function to do this?
Last edited by mik706; Jun 20th, 2003 at 08:38 AM.
Mik706
-
Jun 20th, 2003, 08:21 AM
#2
Frenzied Member
I'm not really sure what you are trying to do.
Hex and decimal are just 2 ways of displaying the contents of your variable. You can't convert the variable from hex to decimal.
-
Jun 20th, 2003, 08:29 AM
#3
Thread Starter
Addicted Member
I have for example a string:
this string contaings "8A"
i want to convert this from a hex representation to a decimal ie
Cint(&H8A&) = 138
-
Jun 20th, 2003, 08:34 AM
#4
Re: Hex to decimal
What's the variable type?
What's stored in the variable?
If it is a string, containing "&HA" then Cint(variable) will work fine
if it is just "A" then use Cint("&H" & variable)
-
Jun 20th, 2003, 08:38 AM
#5
Thread Starter
Addicted Member
Thanks Si i think i have been trying to over complicate the problem.
-
Mar 31st, 2004, 04:09 AM
#6
New Member
Help! Got the same problem but it wont work when i need to convert this hex value(CB00) It should convert to 51,968 decimal.
-
Mar 31st, 2004, 05:20 AM
#7
Thread Starter
Addicted Member
Try:
VB Code:
Dim hHex As String
Dim dDec As Long
hHex = "CB00"
dDec = CLng("&H" & hHex)
msgbox dDec
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|