Help for float byte
#1
Posted 12 June 2009 - 10:19 PM
i've a little problem in my program:
i would convert a decimal value (float) into hex value
could you help me please?
I'm sorry for my bad english but i'm italian
thanks
#2
Posted 12 June 2009 - 10:26 PM
#3
Posted 12 June 2009 - 10:40 PM
#5
Posted 12 June 2009 - 10:53 PM
Could you show what you are working with?Yes but my problem is that i'm working with float byte and i don't know to set that are float byte
eMyvnE
#6
Posted 12 June 2009 - 10:57 PM
You need to create a value for a variable which is of type float and then read it as type ptr I thinkYes but my problem is that i'm working with float byte and i don't know to set that are float byte
$sF = Dllstructcreate("float") $sB = DllStructCreate("ptr",DllStructGetPtr($sF)) DllstructSetData($sF,1,$Floatval) msgbox(262144,"ANS",DllStructGetData($sB),1)
EDIT: Corrected by adding missing parameter for the struct element in DllSTructSetData and DllStructGetData.
Edited by martin, 13 June 2009 - 10:42 AM.
#7
Posted 13 June 2009 - 10:12 AM
mm i don't understand.... can you explain me in pm or with msn?You need to create a value for a variable which is of type float and then read it as type ptr I think
$sF = Dllstructcreate("float") $sB = DllStructCreate("ptr",DllStructGetPtr($sF)) DllstructSetData($sF,$Floatval) msgbox(262144,"ANS",DllStructGetData($sB))
Where put i the float value
i put the float value in the $floatvalue but there is a error the return value is only 0
Edited by cordand, 13 June 2009 - 10:18 AM.
#8
Posted 13 June 2009 - 10:38 AM
Yes, I didn't check what I posted. I should have writtenmm i don't understand.... can you explain me in pm or with msn?
Where put i the float value
i put the float value in the $floatvalue but there is a error the return value is only 0
$sF = DllStructCreate("float") $sB = DllStructCreate("ptr", DllStructGetPtr($sF)) While 1 $floatval = InputBox("Next value", "Enter a number, eg 123.7") If $floatval = "" Then Exit DllStructSetData($sF, 1, $floatval) MsgBox(262144, "ANS", DllStructGetData($sB, 1)) WEnd
This and This might also be useful.
#9
Posted 13 June 2009 - 12:00 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





