Much of the coding you do will be inside methods of a class, so passing the ID around all the time can be a nuisance. Enter the '@' symbol. This symbol is ONLY used when referring to names within the current namespace (current class or any heredity class). And when coding within an instance method and the name happens to be an instance method or property, you can simply drop the need for referencing the ID. So for example:
Code: Select all
double val = @Strength();
string s = @List[idx];
So, it follows, that when referring to static methods and properties within the current namespace, using '@' and ':' are identical and interchangeable. I personally prefer always using colon when referring to local static methods and '@' when referring to local static properties, but that's just me. So a quick summary reference:
class:name - outside a class referencing a define
class:name - outside a class referencing a static property
class:name(...) - outside a class referencing a static method
class:name[id] - outside a class referencing an instance property
class:name(id, ...) - outside a class referencing an instance method
:name - inside a class referencing a define
@name - inside a class referencing a define
:name - inside a class referencing a static property
@name - inside a class referencing a static property
:name(...) - inside a class referencing a static method
@name(...) - inside a class referencing a static method
:name[id] - inside a class referencing an instance property
@name - inside a class referencing an instance property
:name(id, ...) - inside a class referencing an instance method
@name(...) - inside a class referencing an instance method
I think that covers it.