255 byte value...
BlitzMax Forums/BlitzMax Programming/255 byte value... B3D isn't BM.
BM has seperated operators for bitoperation and boolean comparision and a "deeper" knowledge of data types then B3D had.
You operation does simply: not 0 ie not false -> true = 1
For what you want to do, you would need to use the bitwise XOR
$FF ~ r reverts all bits of the byte
BM has seperated operators for bitoperation and boolean comparision and a "deeper" knowledge of data types then B3D had.
You operation does simply: not 0 ie not false -> true = 1
For what you want to do, you would need to use the bitwise XOR
Local r:Byte = 0 If ($FF ~ r) = 255 Then Print "ok with not" If r <> 255 Then Print "ok with <>"
$FF ~ r reverts all bits of the byte
So I was missing something.
Still a bit confusing but it's good to know that the problem was me.
Still a bit confusing but it's good to know that the problem was me.
Hi,
The operator precedence of 'Not' is different in BMX from B3D - use:
If Not (r = 255) Then Print "ok with not"
The operator precedence of 'Not' is different in BMX from B3D - use:
If Not (r = 255) Then Print "ok with not"