Trax Posted September 5, 2017 Posted September 5, 2017 I always thought a binary number was a string of zeros and ones like "01001100" but I must be missing something. Binary() and BinaryToString() don't convert it to what I consider a Binary. What does AutoIT consider to be a Binary number? My ultimate goal is to convert a hex like BFA0D1 to a bit string like 010001101, Is there a function that will do that?
Gianni Posted September 5, 2017 Posted September 5, 2017 There are various functions on the forum to convert numbers to binary (base 2) among others you can use _BaseToBase() by @czardas that allows you to convert from/to various bases bidirectionally That function is included in his math10.au3 udf you can find here: https://www.autoitscript.com/forum/topic/150224-udf-suite/ #include <math10.au3> ; <--- get this udf here: https://www.autoitscript.com/forum/topic/150224-udf-suite/ ConsoleWrite(_BaseToBase("BFA0D1", 16, 2) & @CRLF) ; from base 16 to base 2 ConsoleWrite(_BaseToBase('101111111010000011010001', 2, 16) & @CRLF) ; from base 2 to base 16 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Trax Posted September 6, 2017 Author Posted September 6, 2017 A million thanks Chimp. Just what I was looking for.
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