Simple way to copy last byte of a long to a new variable?
brianm734
Posts: 29
I am pretty new to SPIN. Is there a simple way to copy the last byte (LSB) of a long variable to a new byte sized variable?
Thanks
Thanks
Comments
... or just
byte_variable := long_variable (assuming byte_variable is declared as byte)
-Phil
bytevar := longvar.byte[0]
It's really not necessary for byte 0 (as Phil pointed out above), but useful for the others.
See this link:
http://forums.parallax.com/showthread.php?133583-VAR-Aliases...&p=1024313&viewfull=1#post1024313
Example using the Propeller demoboard or QuickStart LEDs:
http://forums.parallax.com/showthread.php?112970-Word-Sized-constant-in-Byte-array&p=808493&viewfull=1#post808493