PDA

View Full Version : array and highbyte lowbyte



shawn
- 7th November 2010, 18:51
Hello,
Question that I cannot find an answer for. If I have an array like this.

Memory VAR WORD[7]

B0 VAR BYTE
B1 VAR BYTE

And I want to take 1 element out and break it into 2 byte what is the proper syntex.

This
B0 = Memory[1.highbyte]
B1 = Memory[1.lowbyte]

Or This

B0 = Memory.highbyte[1]
B1 = Memory.lowbyte[1]

both examples compile

Thanks
Shawn

mackrackit
- 7th November 2010, 23:43
http://www.picbasic.co.uk/forum/content.php?r=92-Bits-Bytes-Words-and-Arrays

You do realize that "Memory VAR WORD[7]" has 14 BYTES?
So are you really wanting to take a WORD VAR, non array, and splitting it into two BYTES?