BinaryEncode

Rick Harrison harrison at all-auctions.com
Sun Jan 15 23:51:57 EST 2012


Hi Michael,

Ok, I'll try to put in that missing step.

Thank you for taking a look at the code,
and making your suggestion for the correction.

Rick

On Jan 15, 2012, at 10:39 PM, Michael Kann wrote:

> Rick,
> 
> A little more explanation. The numToChar function takes an integer. In your case if you feed the function the integer 119 then it spits out "w" -- which is what you want. At the end of your script you ended up with "01110111", which is the way we "spell" the binary number 119 -- using ones and zeroes. But the numToChar function only works on integers, not the ones and zeroes. So you need one more conversion step to get back to the integer before you use the numToChar function. 
> 
> It looks like if you feed the numToChar nonsense, you get nonsense back without any warning.
> 
> Mike
> 
> 
> on mouseUp
> put numToChar("01110111") into x
> put numToChar(119) into y
> put x && y into fld 1
> end mouseUp
> 
> fld 1 will then contain "_ w"
> 







More information about the use-livecode mailing list