Can anyone please execute these following Jobs in X++ and let me know the output

Hello All:

My apologies for this odd request. I don't have to AX right now. I need these answers ASAP

Can anyone please execute these following Jobs in X++ and let me know the output:

First Job/Script:

int i = 10;
str output = "A";

switch(i)
{
case 10:
output = "B";
i = i + 20;
case 20:
output = "C";
i = i + 10;
break;
case 30:
output = "D";
break;
}
info (strfmt(int2str("%1", i)));
info (output);

 

Second Job:

Int a, b;

Try
{
    a = 5;
    b = 20;
    b -= a;

     if (b > a)
    {
         throw error ("An error has occured");
         error("b cannot be less than a");
    }
}
Catch (Exception::Error)
{
     error ("Process was aborted");
}

Thanks in advance

Shankar

Related
Recommended