On 7/17/22 05:09, aotto1968 wrote:
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.
Make a tip with the sample implementation.
--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email:
[email protected] | +----------------------------------------------------------------------+
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)