Question about symbols
#1

Hello,
I have a few questions about some symbols,the questions are :
- What the symbols _: does ?
- what the difference between > and >> or >>>
- What the symbols |= does ?
- what the symbol ~ does ?
- I saw that someone is using barackets without a function before it,for example: (parts from rBits)
pawn Код:
return ((_: abArray[iIdx] >>> bVar) & bLim);
    if(!(-1 < iIdx < iSize)) {
    (_: abArray[iIdx] &= ~(bLim << bVar));
    (_: abArray[iIdx] |= ((bLim & iValue) << bVar));
    new
        bVar = ((iIdx & ((1 << _: (Bit32 - iShift)) - 1)) << _: iShift),
        bLim = ((1 << (1 << _: iShift)) - 1)
        ;
How does it compile without errors or warnings ?
Reply
#2

_: - clears the tag from variable ( not sure ) - example Float:X becomes normal X.
a>b - logical operator. This returns true(1) if variable a is higher then variable b. ( false -0 if not)
>> >>> - bit operators ( https://sampforum.blast.hk/showthread.php?tid=177523)
for |= and ~ I never saw them

barackets are used to tell program to first do operations inside then use the result- same as you do in maths.

(1+1)*3 is not same as 1+1*3
Reply
#3

Quote:
Originally Posted by Gamer`
Посмотреть сообщение
- What the symbols _: does ?
_: defines a custom tag without giving any error, example:

pawn Код:
new Text3D:asd;
printf("%d", asd); // Will give errors.
printf("%d", _:asd); // Will not give errors.
Quote:
Originally Posted by Gamer`
Посмотреть сообщение
- what the difference between > and >> or >>>
Bit operators.

Quote:
Originally Posted by Gamer`
Посмотреть сообщение
- What the symbols |= does ?
Binary.

Quote:
Originally Posted by Gamer`
Посмотреть сообщение
- what the symbol ~ does ?
Binary.

Quote:
Originally Posted by Gamer`
Посмотреть сообщение
- I saw that someone is using barackets without a function before it,for example: (parts from rBits)
pawn Код:
return ((_: abArray[iIdx] >>> bVar) & bLim);
    if(!(-1 < iIdx < iSize)) {
    (_: abArray[iIdx] &= ~(bLim << bVar));
    (_: abArray[iIdx] |= ((bLim & iValue) << bVar));
    new
        bVar = ((iIdx & ((1 << _: (Bit32 - iShift)) - 1)) << _: iShift),
        bLim = ((1 << (1 << _: iShift)) - 1)
        ;
How does it compile without errors or warnings ?
You can always use functions inside brackets, example:

pawn Код:
GivePlayerMoney(playerid, (500));
Reply
#4

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
_: - clears the tag from variable ( not sure ) - example Float:X becomes normal X.
a>b - logical operator. This returns true(1) if variable a is higher then variable b. ( false -0 if not)
>> >>> - bit operators ( https://sampforum.blast.hk/showthread.php?tid=177523)
for |= and ~ I never saw them

barackets are used to tell program to first do operations inside then use the result- same as you do in maths.

(1+1)*3 is not same as 1+1*3
Thank you very much.
Quote:
Originally Posted by Emmet_
Посмотреть сообщение
_: defines a custom tag without giving any error, example:

pawn Код:
new Text3D:asd;
printf("%d", asd); // Will give errors.
printf("%d", _:asd); // Will not give errors.
You can always use functions inside brackets, example:

pawn Код:
GivePlayerMoney(playerid, (500));
So what this symbol useful for ? (if kalcor added this feature,there should be a good reason for doing this)
about the barackets - yes,but the barackets were used like this:
pawn Код:
stock ThisIsMyStock()
{
    SendClientMessage(playerid,0xC0C0C0,"This is a message");
    (_: array[3] |= ((array1 & array2) << array3));
}
Reply
#5

Actually kalcor didn't made this, it was the CompuPhase.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)