Exam UiRPA All QuestionsBrowse all questions from this exam
Question 18

While performing a code review, it was discovered that a developer failed to use best practices and wrote the following expression in the Condition Field of an If actvity:

Convert.ToBoolean(ExampleInteger) = False

What is the result of the expression referenced above if “ExampleInteger” = 0 and how should the expression in the Condition Field be written based on best practices?

    Correct Answer: A

    If ExampleInteger is 0, then Convert.ToBoolean(ExampleInteger) results in False. Since the condition is checking for equality to False, the expression is True. The condition field based on best practices should simply use Convert.ToBoolean(ExampleInteger) since Convert.ToBoolean will already evaluate to True or False based on the integer value.

Discussion
Logan2007Option: C

C is the correct answer. As long as it is other than '0' , negative or positive value will go thru True

DesingLIVOption: C

CBool(variable2) false

KarolAndrzejOption: C

if ExampleInteger is 0 then the condition result is False

PM2Option: A

A is the correct answer !