algiuxas Posted November 1, 2016 Share Posted November 1, 2016 (edited) Hello everybody, I have couple characters, they are A, B, C. They are converted to hexadecimal numbers: 41, 42, 43. ABC(string) = 414243(hex) = 4276803(dec) I want to convert for example 4276803 to string like ABC and opposite. Sorry for my bad English. EDIT: I found Chr and Asc functions, they are made only for characters, I need functions that would be for strings. Edited November 2, 2016 by algiuxas After switching years ago to Linux, sadly I don't use AutoIt anymore. Link to comment Share on other sites More sharing options...
jchd Posted November 1, 2016 Share Posted November 1, 2016 Things aren't that simple. Look at what gives a naive approach: Local $n = 4276803 ConsoleWrite(BinaryToString($n)) ConsoleWrite(@LF) Local $s = "ABCdef" ConsoleWrite(StringToBinary($s) & @LF) Windows platforms are little-endian, which means that integers (for instance) are stored with low-order bytes first. That's why your 4276803 value gets interpreted as "CBA". See the difference here: Local $n = 4276803 ConsoleWrite(Hex($n) & @LF) ConsoleWrite(Binary($n) & @LF) If you intend to thusly process random strings then you'll have to process them in a loop, character by character. StringToASCIIArray and StringFromASCIIArray will help then. algiuxas 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Grosminet Posted November 1, 2016 Share Posted November 1, 2016 (edited) Using the AutoIT help tool, you can easily find : BinaryToString() : Remarks Unlike String() which returns a hexadecimal representation of binary data, this function will assume the binary data is a string value and convert it appropriately. See "Unicode Support" for a detailed description. Related Binary, IsBinary, String, StringToASCIIArray, StringToBinary , Alain. Please have a look to the JCHD's post for constructive remarks about your needs. Edited November 1, 2016 by Grosminet Better advice Link to comment Share on other sites More sharing options...
jchd Posted November 1, 2016 Share Posted November 1, 2016 @Grosminet Maybe you could read my post above to understand why this doesn't work. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Grosminet Posted November 1, 2016 Share Posted November 1, 2016 @jchd - well, well, well Maybe have a look on timestamps for your answer and mine to avoid posting such remarks ... But I agree with you, this is not so simple ... Link to comment Share on other sites More sharing options...
jchd Posted November 1, 2016 Share Posted November 1, 2016 1 minute ago, Grosminet said: Maybe have a look on timestamps for your answer and mine to avoid posting such remarks ... I closely look and ... see nothing deserving what you say. Also it isn't too late to edit your misleading advice. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) 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