|= and &
#5

Those are bits operators, show me the code that you're trying to use it.

An example for this:
pawn Код:
//normal 32-bit var, that contains an integer value corresponding to 2
//which means 0010 in binary.
new var = 2; // 0010
If you create another var with the value corresponding to 4, and use the OR bit operator like this:
pawn Код:
new var2 = 4; //4 = 0100 binary
var2 |= var; // 0100 | 0010 = 0110
It will join the bits which are enabled.

So, 0100 has the third bit enabled, and 0010 ain't, then it will turn enabled.
The same thing for the second bit.
Reply


Messages In This Thread
|= and & - by iBots - 08.01.2015, 21:29
Re: |= and & - by DavidSparks - 08.01.2015, 21:30
Re: |= and & - by Schneider - 08.01.2015, 21:32
Re: |= and & - by DavidSparks - 08.01.2015, 21:32
Re: |= and & - by WLSF - 08.01.2015, 21:36
Re: |= and & - by Mauzen - 08.01.2015, 21:43
Re: |= and & - by iBots - 08.01.2015, 21:52
Re: |= and & - by iBots - 08.01.2015, 22:00
Re: |= and & - by WLSF - 08.01.2015, 22:01
Re: |= and & - by Vince - 08.01.2015, 22:02

Forum Jump:


Users browsing this thread: 1 Guest(s)