As said in the book Microsoft Dynamics AX 2009 Programming: Getting Started it´s needed to put semicolons after declarations in x++:
The extra semicolon after the variable
declaration is mandatory as long as
the first line of code is not a
keyword. The semicolon tells the
compiler that variable declarations
have come to an end. You cannot
declare new variables after this
semicolon.
(copied directly from the book, unchanged, if needed I’ll remove it)
However, when I remove the semicolon and run the job, there’s absolutely no error or problem:
static void Job1(Args _args)
{
str string1 = "STACKOVERFLOW";
;
print string1;
pause;
}
works just as
static void Job2(Args _args)
{
str string1 = "STACKOVERFLOW";
print string1;
pause;
}
Is it really needed? Should I get used to using it?
It’s explained rather elegantly here.
A key quote [emphasis mine]: