user3824908
user3824908

Reputation:

Microsoft Dynamics AX - java programist need information

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

Answers (4)

10p
10p

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

tgolisch
tgolisch

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

Geoffrey DELMEE
Geoffrey DELMEE

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

DAXaholic
DAXaholic

Reputation: 35338

Regarding your underscore question:
A widely spread convention is to use leading underscores to indicate passed parameters e.g.

public void foobar(int _myInt, str _myStr)
{
 ...
}

See here for the best practice MSDN page describing this convention.

Upvotes: 3

Related Questions