cordand Posted June 12, 2009 Share Posted June 12, 2009 Hi guys i'm just registered in this forum ...: 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 Link to comment Share on other sites More sharing options...
Zisly Posted June 12, 2009 Share Posted June 12, 2009 Checkout Hex in the helpfile. Link to comment Share on other sites More sharing options...
cordand Posted June 12, 2009 Author Share Posted June 12, 2009 Yes but my problem is that i'm working with float byte and i don't know to set that are float byte Link to comment Share on other sites More sharing options...
Skruge Posted June 12, 2009 Share Posted June 12, 2009 Yes but my problem is that i'm working with float byte and i don't know to set that are float byteDoes Binary give you the result you're looking for? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
trancexx Posted June 12, 2009 Share Posted June 12, 2009 Yes but my problem is that i'm working with float byte and i don't know to set that are float byteCould you show what you are working with? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
martin Posted June 12, 2009 Share Posted June 12, 2009 (edited) Yes but my problem is that i'm working with float byte and i don't know to set that are float byte 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,1,$Floatval) msgbox(262144,"ANS",DllStructGetData($sB),1) EDIT: Corrected by adding missing parameter for the struct element in DllSTructSetData and DllStructGetData. Edited June 13, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
cordand Posted June 13, 2009 Author Share Posted June 13, 2009 (edited) 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))mm 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 Edited June 13, 2009 by cordand Link to comment Share on other sites More sharing options...
martin Posted June 13, 2009 Share Posted June 13, 2009 mm 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 Yes, I didn't check what I posted. I should have written $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. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
cordand Posted June 13, 2009 Author Share Posted June 13, 2009 this is perfetct!!! thank you!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now