nerdexam
Microsoft

MB6-704 · Question #85

You have the following X++ statement: You need to identify the output of the statement. What should you identify?

The correct answer is B. Wrong value of variableB variable. By default the integer variables VariableA and VariableB will be set 0. Break; statement will be run as VariableA is 1. The line error("Wrong value of variableB variable."); will be executed as VariableB VariableA. No exception is thrown. Note: A frequently thrown exception is…

Develop X++ code

Question

You have the following X++ statement:

You need to identify the output of the statement. What should you identify?

Options

  • AProcess was cancelled.
  • BWrong value of variableB variable.
  • CVariable2 cannot have value greater than 2.
  • DWrong value of variableB variable.

How the community answered

(61 responses)
  • A
    10% (6)
  • B
    84% (51)
  • C
    5% (3)
  • D
    2% (1)

Explanation

By default the integer variables VariableA and VariableB will be set 0. Break; statement will be run as VariableA is 1. The line error("Wrong value of variableB variable."); will be executed as VariableB VariableA. No exception is thrown. Note: A frequently thrown exception is Exception::error enumeration value. This exception is thrown in a variety of situations. It is common practice to write diagnostic information to the In- folog before throwing the exception, and the Global::error method is often the best way to do that. In X++ code, the static methods on the Global class can be called without the Global:: prefix. For example, the Global::error method can be called simply as error("My message.");. Exception Break: Indicates that the user has pressed BREAK or CTRL+C.

Topics

#exception handling#X++ output#error messages#control flow

Community Discussion

No community discussion yet for this question.

Full MB6-704 Practice