Hi,
*switch* has a *fallthrough* but only for the top-level:
switch -glob aaab {
a*b -
b {expr {1}}
a* {expr {2}}
default {expr {3}}
}
I would like top have a *fallthrough* which act like a *continue* in
while :
switch -glob aaab {
a*b {
do-something
fallthrough b ; # restart *switch* with "b" instead of "aaab"
}
b {expr {1}}
a* {expr {2}}
default {expr {3}}
}
Flow: "a*b" is doing some stuff and after *fallthrough* the *switch*
restart with "b" stuff.
*switch* get with *fallthrough* a "loop-like" feature.
The reason for this requirement is the complicate simulation for *fallthrough* :
set key aaab
while true {
switch -glob $key {
a*b {
do-something
set key b
continue
}
b {expr {1}}
a* {expr {2}}
default {expr {3}}
}
break
}
thanks.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 22:01:37 |
Calls: | 9,726 |
Calls today: | 16 |
Files: | 13,741 |
Messages: | 6,182,240 |