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

  1. You don’t need int2str function. Use info (strfmt("%1", i));
    Result -
    40
    C

An error has occured
Process was aborted

Thanks Kranthi

One more quick question:

two classes written in X++ with the following code:

Class DirParty
{
string getContactInfo(LogisticsLocationRecId _location)
{
some code block
}

server static boolean addlocation()
{
some code block
}

client private static boolean addlocationClient()
{
some code block
}

private void update()
{
some code block
}

protected void duplicateCurrentParty()
{
some code block
}

}

Class DirParty_Person extends DirParty
{
public void write()
{
//To be implemented
}
}

Which three methods of the DirParty class are accessible from the Write method?

A. duplicateCurrentParty()
B. addlocation()
C. update()
D. getContactlnfo()
E. addLocationClient0

Kindly advice

msdn.microsoft.com/…/aa891619.aspx