njacques
asked on
converting hex value to decimal value
i have a problem, in my app. i have to convert decimal to hex (no problem with hex(variable)) but i also want to do the opposite. I want to convert a hex value into a decimal value and i have not found any way to do it... help me..
p.s: i use vb-pro 3
p.s: i use vb-pro 3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
rougedec=hextodec(rouge) and NOT rougedec=hextodec("rouge")
I've copied your code for testing and works fine.
Let know if it works now
Johan
I've copied your code for testing and works fine.
Let know if it works now
Johan
ASKER
i found out that val(&hff)
will do the job so o only got to do this
toconvert$ = "&h" + rouge
decimal = val(toconvert$)
and it converts, save a lot of time and coding
thanks anyway
bye
will do the job so o only got to do this
toconvert$ = "&h" + rouge
decimal = val(toconvert$)
and it converts, save a lot of time and coding
thanks anyway
bye
ASKER
If Len(text4.Text) < 6 Then
MsgBox ("Please enter a 6 digit hexadecimal number (RRGGBB)")
Exit Sub
End If
Dim rouge As String
Dim vert As String
Dim bleu As String
rouge = UCase$(Left(text4.Text, 2))
vert = UCase$(Right(Left(text4.Te
bleu = UCase$(Right(text4.Text, 2))
rougedec = HexToDec("rouge")
vertdec = HexToDec(vert)
bleudec = HexToDec(bleu)
label1.Caption = rougedec
label2.Caption = vertdec
label3.Caption = bleudec
hscroll1.Value = Val(rougedec)
hscroll2.Value = Val(vertdec)
hscroll3.Value = Val(bleudec)
the user enters a 6 digit string and the app split the rr-gg-bb so that they can be converted separatly. when the app get to you function call, the labels get blank... help me (am i using your function right) could my code cause this?
help me