Switch Statement


#1

1) Give a description of the problem
I am trying to create a Switch statement using a string with a Case statement that will execute if it matches one of multiple, separate strings. But I cannot figure out the syntax for the Case statement.

2) What is the expected behavior?
Case executes if 1 of several strings match the Switch text

3) What is happening/not happening?
I cannot get Case to execute when more than 1 string in the Case

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
image

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


Where is the switch statement?
#2

You need to change the Case Traversal Policy of the SWITCH block to Fall-through (programmer style) … examples:

webCoRE_switch-case-example_2b

webCoRE_switch-case-example_3b

CASE statements use constant expressions, although I think WC allows range expressions.


#3

That is not the problem. In my original example, I want the switch stmt to accept the 1st case. It does not do it and I cannot figure out how to do it. But no worries, I replaced the Switch/Case with If stmts and that works great.