how to look at binary variables

Mark Smith mark at maseurope.net
Mon May 26 18:28:48 EDT 2008


The simplest way is:

put numToChar(1) into tByte

this way, tByte is a single byte with the value 0x00000001

For reading the individual bits of returned values, you can use the  
'b' or 'B' format of the binaryDecode function, which will give you  
strings of 1's and 0's.

Best,

Mark


On 26 May 2008, at 23:19, marty at ucls.uchicago.edu wrote:
> Hi all --
>
> In order to poll a certain device that's on a serial port, I'm  
> supposed to
> send it a single byte containing the number 1.  To me, that means
> 00000001.  How do I put that into a variable and send the variable  
> to the
> device?
>
> The documenatation for binaryEncode() and binaryDecode() is  
> confusing me.
> If I put binaryEncode("C1",1) into a variable, that should do it,  
> right?
> How can I see what's really in the variable, how big it is, etc.?
>
> Also, I'll be reading bytes back from the device, and want to look  
> at them
> bit by bit.  How can I do that?
>
> Any pointers would be appreciated!
>
> Thanks,
>   - marty
>
> --
> Marty Billingsley
> The University of Chicago Laboratory Schools
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list