Ax syntax error

 static void Job(Args _args) 
 { 
    int number=10;
    do
     {
        print (strfmt("current number = %1", number));
        number --;
     }while (number != 0)  
  }

This job is for do-while testing only in X ++, and I get a “syntax error” in the last '}'

I am new to Dynamics AX and X ++, so I don’t know if there is something that I am missing, but I would say that it should work.

----- [EDIT] ----- the
second part of the question was moved to a separate question

+3
source share
1 answer

As with many C style languages, the DO WHILE loop requires a semicolon at the end of the while test:

http://msdn.microsoft.com/en-us/library/aa842320.aspx

SYNTAX


 {statement}
 
 () ;

:

static void Job(Args _args) 
{ 
  int number=10;
  do
   {
      print (strfmt("current number = %1", number));
      number --;
   }while (number != 0); <-- semicolon required here
}

, , , -, .

+5

Source: https://habr.com/ru/post/1727254/


All Articles