Ioannis,
In the abobe example although Bval is byte, internally the PBPL holds the temporary result in a long variable which in turn can hold negative numbers too.
So the result of the IF-THEN will goto negative.
Are you sure about that?
I thought that although you could "manually" look at the highest bit (IF BVal.7 THEN Negative) to see if it's negative doing a comparison for less than zero only really works with variables declared as LONGs. Or are you saying that it'll actually work because you're doing an intermediate calculation in your actual comparison ie
Code:
BVal VAR BYTE
BVal = 0
If (BVal - 1) < 0 THEN Negative
Works, while...
Code:
BVal VAR BYTE
BVal = 0
BVal = BVal - 1
If BVal < 0 THEN Negative
..doesn't?
Guess I could try it myself....
/Henrik.
Bookmarks