Instructions
201 C-Control Pro IDE
© 2013 Conrad Electronic
-
Negative Sign
-(2+2)
-4
4.3.5.2 Bitoperators
Bit operators are only allowed for Integer data types
Operator
Description
Example
Result
And
And
&H0f And 3
&Hf0 And &H0f
3
0
Or
Or
1 Or 3
&Hf0 Or &H0f
3
&Hff
Xor
exclusive Or
&Hff Xor &H0f
&Hf0 Xor &H0f
&Hf0
&Hff
Not
Bit inversion
Not &Hff
Not &Hf0
0
&H0f
All these Operators work arithmetically: E.g. Not &H01 = &Hfe. Both values are evaluated to
true in an If expression. This is different to a logical Not operator, where Not &H01 = &H00.
4.3.5.3 Bit-Shift Operators
Bit-Shift operators are only allowed for Integer data types. With a Bit-Shift operation a 0 will always
be moved into one end.
Operator
Description
Example
Result
<<
shift to left
1 << 2
3 << 3
4
24
>>
shift to right
&Hff >> 6
16 >> 2
3
4
4.3.5.4 In- /Decrement Operators
Incremental and decremental operators are only allowed for variables with Integer data types.