472
Views
4
Comments
Switch statement

While taking one of the quiz course "LOGIC", on the Guided Path - Becoming a Reactive Web Developer, I failed one question and I can't understand the explanation... seems quite contraditory, as if the wrong answer is considered the right one. Someone... please... if the image below is correct, tell me what am I getting wrong.

DUVIDA OUTSYSTEMS.PNG
UserImage.jpg
vikas sharma
Champion

Hi,

Basically switch is use to excecute only one condition. But if we have more than one true condition then lets say compiler find first true condition then flow will go into that first condition execution and now there will not be any way to come back to switch again to check the next switch statements.

regards

UserImage.jpg
vikas sharma
Champion

Hi,

Basically switch is use to excecute only one condition. But if we have more than one true condition then lets say compiler find first true condition then flow will go into that first condition execution and now there will not be any way to come back to switch again to check the next switch statements.

regards

2021-01-19 14-07-32
Tom Zhao

Hi 

Addition to Vikas Sharma' answer. You can refer to official doucument about Switch

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Implementing_Logic/Logic_Tools/Switch


It's only run one times not all true branches

Kind Regads

2023-04-16 15-25-31
Krishnanand Pathak

Hi Nuno,

This Question is asking false option right!
As we know switch is used when we have to decide
only one output branch every time at runtime based on condition.
Option B is false because it states Every(that means it can have more than one true branch) but switch always have one true branch at a time.

Regards,
Krishnanand Pathak

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.