monitorlg Posted February 16, 2009 Share Posted February 16, 2009 Hi All, I am writing a script where i have to form a packet, such that when i frame the decimal value it should convert it into byte value. Can any body suggest me which all function to use in this conversion. Link to comment Share on other sites More sharing options...
Authenticity Posted February 16, 2009 Share Posted February 16, 2009 ANDing the decimal with 0x000000FF is enough I believe. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 16, 2009 Share Posted February 16, 2009 Hi All,I am writing a script where i have to form a packet, such that when i frame the decimal value it should convert it into byte value.Can any body suggest me which all function to use in this conversion.What form is the decimal number in to start with? If it is an integer type already, it doesn't need conversion. The number is already stored as a binary word, it is just presented to you converted to decimal.If it is an ANSI or Unicode string representation of a decimal number, then you can get an integer type with just Int() or Number().ANDing the decimal with 0x000000FF is enough I believe.That will only work if it's a single decimal digit, and is already converted to an integer type (vice string). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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