Create a when
condition block, where whether a block of logic is
executed or not depends on the conditional.
Create a when
condition block, where whether a block of logic is
executed or not depends on the conditional.
condition to execute upon
logic that runs only if cond
is true
when ( myData === 3.U ) { // Some logic to run when myData equals 3. } .elsewhen ( myData === 1.U ) { // Some logic to run when myData equals 1. } .otherwise { // Some logic to run when myData is neither 3 nor 1. }
Returns the current when
condition
Returns the current when
condition
This is the conjunction of conditions for all whens
going up the call stack
when (a) {
when (b) {
when (c) {
}.otherwise {
when.cond // this is equal to: a && b && !c
}
}
}