Hi,
BYTES and WORDS are unsigned in PBP. So if A is a BYTE sized variable and has the value of the 0 then A=A-1 will result in A being 255 which isn't less than 0.....
One way is to simply check the highest bit of A.That will tell you if A is < 0 (or >128) but since the maximum value for A is 63 it should work.Code:If A.7 THEN A=63
HTH
/Henrik.
EDIT: A little late there but damn, that's two almost identical responses, almost scary....




Bookmarks