Page 1 of 1

How to read byte by byte in DS

Posted: Wed Jan 31, 2007 2:21 pm
by Shree0410
How to read a string byte by byte in a job
For example my input string will have a value of SACHIN, I want to read S first, A second, C third so on..
I want to take S character convert into binary, take A, convert into binary and add both binary numbers and take C convert into binary add the value to previous so on..The lenght of the input string is not fixed, I may get N number of bytes.

Posted: Wed Jan 31, 2007 2:57 pm
by paddu
Shree0410,

So what ever is the length of the string , you want to add all the character values in binary and the result of total sum also in Binary ?????

AND PLEASE MOVE THIS POST to PX

Posted: Wed Jan 31, 2007 3:12 pm
by Shree0410
Yes Paddu

Posted: Wed Jan 31, 2007 3:30 pm
by ray.wurlod
Surely this is the simplest of C functions to write?

Initialize a integer to 0, step through your string from postion 0 to len-1 taking the character value and incrementing your integer.