Reputation:
I have to work with Dynamics 2012 r3 and x++ and I wonder: what is "::" - its inherit, implementation or what? why some variables are write like "_vensGroup" - that _ means something or this is just convention?
Upvotes: 2
Views: 210
Reputation: 6686
In addition to the other answers to your question, ::
is used not only to call to static table/class methods, but for other purposes as well, e.g. call methods in maps or reference enums.
Upvotes: 3
Reputation: 6744
To answer both questions:
:: is a scope dereference to a (static) method (as opposed to . which dereferences a variable, constant or property), usually for the Global scope, but it could be for other similar scopes. It is reserved.
The underscore prefix is just a naming convention. It is not part of the language.
Upvotes: 3
Reputation: 782
:: is a scope. It allows you to use class method (on tables and classes). The point is used to call an object method. The scope is also used to call values on BaseEnum.
_ is a prefix for parameters. It's a convention. It allows you to recognize local variable and parameters. As parameters are not ment to be changed in a method (they are passed by value), you will always be able to distinguish it from local variables and use them in your code.
Upvotes: 4