Table Of Contents

Switch Primitive

Last Modified: June 10, 2021

A statement that defines an expression to evaluate to determine which section of code, or Case Statement, to execute.

The Switch statement executes the case with the Case Value that matches the value of the Test Expression. If no cases match the test value, a default case executes instead. When you add a Switch to your real-time sequence code, the editor automatically creates a Cases section for the test cases and a DefaultCase, which is another Case Statement.

Build your test code by adding additional cases to the Cases section. You can then add code to define the execution of each case, including the default.

Property/Section Description
Test Expression Specifies the expression to evaluate to determine the code to execute.
Description Specifies a description for the current item. This text appears when you hover over the item in the Stimulus Profile Editor.

Recently Viewed Topics