DevII Lab3.3 can not instantiate a class

pretty frustrating… no clue why that source code does not want to compile…

static void Job1(Args _args)

{

PrintMyName PrintMyName;

PrintMyName = new PrintMyName(); <<---- compiler breaks here

PrintMyName.setMyName();

PrintMyName.printMyName();

pause;

}

(first post… I am a NAV developer who wants to learn about AX development)

wow… 64 people read this post and nobody answered. I know that it is likely that my question is rather silly but I would be happy for every hint you guys can give me…

static void Job1(Args _args)

{

PrintMyName PrintMyName;

; <<– looks like another ; must follow after variable declaration (would be awesome if somebody could explain that to me)

PrintMyName = new PrintMyName();

PrintMyName.setMyName();

PrintMyName.printMyName();

pause;

}

Please mention the version of AX in your question/post.

The variable declaration and the rest of the logic in a method should be seperated with a semi colon in AX 2009 and which is not required in AX 2012. http://msdn.microsoft.com/en-us/library/aa598112(v=ax.50).aspx

Thank you very much Kranthi. That makes a lot of sense now. I was using 2012 Documentation and developed in 2009 (yeah… I know… stupid… but my 2012 vpc crashed and I thought DEV basics should be the same in 2012/2009) :o)