I'm sure there's an explanation for this.
I had some code that used the '|' (or) operator to join two bytes into a 16 bit value. I recently upgraded from a version that was about 1 year old to V2.14 and it seems something has changed.
Here is a simplified case to reproduce what I am seeing. Basically, the code that joins the bytes using '+' and using '|' used to do the exact same thing, but now the '|' doesn't seem to work right.
Quote:
uint16 Z1;
uint8 b1 = 2;
uint8 b2 = 2;
string str;
//Using '+'
Z1 = (b1 & 0x00FF) + ((b2 << 8) & 0xFF00);
b1 = Z1 & 0x00FF;
b2 = (Z1 >> 8) & 0x00FF;
str = "First Run - b1=" + b1 + " b2=" + b2 + "\n";
//Using '|'
Z1 = (b1 & 0x00FF) | ((b2 << 8) & 0xFF00);
b1 = Z1 & 0x00FF;
b2 = (Z1 >> 8) & 0x00FF;
str += "Second Run - b1=" + b1 + " b2=" + b2 + "\n";
and the output in str is
Quote:
First Run - b1=2 b2=2
Second Run - b1=2 b2=0
Thanks in advance.