When copying two bytes into a word, it is important to copy the low byte first. This is because the high byte of the word var is cleared when the word var is set to a byte value or variable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there an easy way to use words ( 2 bytes ) and then access the high and low byte seperately and
efficiently?
Russ
Something like this is the best way:
dim WordVar as word
LowByte = WordVar
HighByte = WordVar_H
To copy back the other way:
dim WordVar as word
WordVar = LowByte
WordVar_H = HighByte
When copying two bytes into a word, it is important to copy the low byte first. This is because the high byte of the word var is cleared when the word var is set to a byte value or variable.