The negate operator ('-') doesn't seem to work with constants of unsigned type. For example:
Took me forever to track down this as the culprit in some code I have!
I know you will say that I should use signed constants if the largest value will fit into it, but coming from the good ol' efficient programming days I used the smallest type that would fit the bill.
Still, it makes me wonder why constants behave this way and not variables...
Russell
p.s. I didn't put this in Bug Reports because I'm not sure if this is expected behaviour for an unsigned constant or not.
Const con1:Short = 1 Local con2:Short = 1 Print -con1 ' Prints 65535 Print -con2 ' Prints -1 as expected (variables not affected it seems)
Took me forever to track down this as the culprit in some code I have!
I know you will say that I should use signed constants if the largest value will fit into it, but coming from the good ol' efficient programming days I used the smallest type that would fit the bill.
Still, it makes me wonder why constants behave this way and not variables...
Russell
p.s. I didn't put this in Bug Reports because I'm not sure if this is expected behaviour for an unsigned constant or not.