[HELP] which use of these symbols ?
#1

i not know the use correct of these symbols:

Код:
_:
~:
~=
^=
|=
any people ?

thanks .
Reply
#2

_: Tag override
~: Doesn't exist. A ~ on it's own (ex ~variable) is bitwise not
~= Also doesn't exist (I think, not sure)
^= Bitwise Exclusive Or, assign new value to the variable on the left of the operator
|= Bitwise Or, assign new value to the variable on the left of the operator
&= Bitwise And, assign new value to the variable on the left of the operator
Reply
#3

you can post exemples ?

pawn Код:
new Text:textdrawid;

ShowPlayerTextDraw(playerid, _:textdrawid);
pawn Код:
new a = 0;
a ^= 2;
pawn Код:
new a = 0;
a |= 5;
pawn Код:
new a =0;
a &= 169;
this is correct ?
Reply
#4

pawn Код:
new Text:MyText;
MyText = TextDrawCreate(...);

printf("Textdraw id: %d", MyText); // Tag mismatch
printf("Textdraw id: %d", _:MyText); // No more tag mismatch
For the bitwise operators, you'll need to dig deeper. XOR'ing some value with an integer makes pretty much no sense. If you do, for example,
pawn Код:
new a = 0b0101; // 5
a ^= 0b0110; // 6
This will be done:
Код:
0101 // 5
^
0110 // 6
----
0011 // 3
I suggest reading the section about binary operators: https://sampwiki.blast.hk/wiki/Binary#Binary_operators
Reply
#5

I THINK ~= means almost equal to.

For example: 5.56 ~= 5.6.

Don't see the use of it in PAWN tho...
Reply
#6

Nope, it does not exist. Check the manual, pages 105 through 109 and page 112.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)