![]() |
Strange operators
Explain these to me! Please.
NPC Code:Bitwise-Or a | b Also, why do people use := sometimes, instead of =? |
They aren't strange. Honestly, there is a big internet out there and some pages actually exist to explain such things. And, there are even tools which make locating these pages quick and easy. Imagine that!
|
>_> I tried that. I couldn't find much on what they do, just big formulas.. That were really confusing.
|
http://en.wikibooks.org/wiki/Program...harp/Operators
Here's some I found in C#, i'm sure they will have the same principles in GS2. Quote:
From this: a = a + 1 to this: a := +1 Something like that, as I said i'm not sure, and I havent actually tryed because I just use a = a + 1 :P |
No, := is the same thing as =. In Delphi, assignment is done with :=.
As for the bit operators, they adjust the bits in a number. A google of 'bitwise operators' produces plenty of pages explaining them. Such as : http://download.cdsoft.co.uk/tutorials/bitops/ |
i haven't seen := used as an assignment operator since I took classes in Pascal. Good memories. C++ and Gscript are better tho.
|
Quote:
|
Quote:
Bitwise Operators (GameDev) |
Quote:
It would be nice if this operator was given unique functionality as a "delayed assignment operator," meaning not to assign the value until the next time it's modified (kindof like preincrement, but more in a sense of preassignment). Considering it's definition in the language is already defined, though.. doubt it will change. The question of modify it to behave this way would be, would you want to save the value that it would be assigned as it is called, or delay the execution until the assigned operator is modified. |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 08:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.