02-01-2008 05:39 PM
02-01-2008 06:38 PM
02-01-2008 09:59 PM
04-11-2014 04:10 AM
Here you can find how to convert a string to binary(I changed the display format to hexa 😉 to see more clearly my message).
I made it for 3 bytes length a message
Enjoy
04-11-2014 08:55 AM - edited 04-11-2014 08:56 AM
Is there a reason to add this to a 6 year old thread?
The person who posted this question hasn't logged into the forums in almost as long.
04-12-2014 05:53 AM
I ramarked that the question has been written 6 years ago ;).
It's just to help others how are dealing with the same issue ^_^.
I had the same problem before writing the solution. So I think that it could be useful for others.
Have a nice day 😉 and hope that you'll do the same for questions not answered ^_^
04-12-2014 08:42 AM
You did not remark in your message that the thread was 6 years old.
And an answer was given in this thread. I was the one who answered the thread. It just so happened that the original poster never came back and said they needed any more help.
04-12-2014 11:46 AM - edited 04-12-2014 11:48 AM
Abdelhakim_ZOUAKI wrote:It's just to help others how are dealing with the same issue ^_^.
I had the same problem before writing the solution.
How is that the same issue. here is what you attached:
First of all, you posted very specialized code that translates a binary string diagram constant with exactly three characters into three different boolean arrays named "header #" (for some unknown reason). It has nothing to do with the original question and has very little to do with "binary". It is not the "same problem" by a long shot. The various headers are not even arranged in any logical order.
Then your code is also way too complicated., for example, you don't need to wire the indices if you want the first three elements in order. The code is also not scalable, because you need to do significant modifications if you later require a program that does the same for longer or shorter strings. The program also does not check if the string is the correct lenght, making it hard to tell if something is wrong.
Abdelhakim_ZOUAKI wrote:So I think that it could be useful for others.
Have a nice day 😉 and hope that you'll do the same for questions not answered ^_^
No, it is not useful in the current form. I challenge you to simplify and generalize your program to take strings of any lenght and convert it into a single boolean array of the correct lenght. A good exercise. Try it! 🙂