SA-MP Forums Archive
[HELP] which use of these symbols ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] which use of these symbols ? (/showthread.php?tid=257260)



[HELP] which use of these symbols ? - TheGarfield - 25.05.2011

i not know the use correct of these symbols:

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

thanks .


Re: [HELP] which use of these symbols ? - Vince - 25.05.2011

_: 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


Re: [HELP] which use of these symbols ? - TheGarfield - 25.05.2011

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 ?


Re: [HELP] which use of these symbols ? - Vince - 25.05.2011

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


Re: [HELP] which use of these symbols ? - Mean - 25.05.2011

I THINK ~= means almost equal to.

For example: 5.56 ~= 5.6.

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


Re: [HELP] which use of these symbols ? - Vince - 25.05.2011

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