Forum Discussion
Nik
Cirrus
Feb 07, 2015breaking out of a switch statement?
is it possible to break out of a switch statement like you would a loop? the break command doesn't seem to work.
my goal is to say.. if condition is met then use the default action, like this:
...
giltjr
Nimbostratus
Feb 07, 2015Why have if's inside a switch or even use default. Why not:
switch blah {
"knownbadcond1" {set badFlag 1}
"knownbadcond2" {set badFlag 1}
"knownbadcond3" {set badFlag 1}
"knowngoodcond1" {do good stuff1}
"knowngoodcond2" {do good stuff2}
"knowngoodcond3" {do good stuff3}
}
if { [info exists badFlag] && $badFlag } { tell the user he sucks }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects