O'Reilly logo

Learning MS Dynamics AX 2012 Programming by Erlend Dalen, Mohammed Rasheed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators

Operators are used to manipulate or check the values of variables. There are three different types of operators that we use when developing AX:

  • Assignment operators
  • Relational operators
  • Arithmetic operators

Assignment operators

In order to assign values to variables, you have to use an assignment operator in X++. The most obvious operator is, of course, the = operator that will assign the value to the right of the = operator to the variable on the left. This means that the car variable in the following example will be assigned the value BMW.

str  car = "BMW";

Other assignment operators include ++, --, +=, and -= as you already know if you have been programming in C#, C++, Java, and so on. Refer to the following example for an explanation:

static ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required