A switch-case-statement on buttons [SWITCH], [CASE], [DEFAULT] has to be conform to the following syntax.
#SWITCH expression: #CASE constant1: statement1 #CASE constant2: statement2 [...] #DEFAULT alternative statement
At least one case is expected. Other than that the number of cases is unlimited. All combinations of types are possible.
Syntax
#SWITCH expression: #CASE constant1: statement1 #CASE constant2: statement2 [...] #DEFAULT alternative statement
Types
Variable Name | Value Type | Variable Type | ||
---|---|---|---|---|
Expression: | exp | real, complex | boolean, scalar, vector, matrix, signal, xy-data | |
Constant: | con | real, complex | boolean, scalar, vector, matrix, signal, xy-data | |
Statement: | sta | real, complex | boolean, scalar, vector, matrix, signal, xy-data | |
Result: | real, complex | boolean, scalar, vector, matrix, signal, xy-data |
Calculator Input
Use the
, , and buttons to complete the operation.Example
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL | 1 | 1 | |
c | Result | REAL | 6 | #SWITCH x: #CASE -1: 4 #CASE 0: 5 #DEFAULT 6 |