On 20/05/2022 10:17, aotto1968 wrote:
have a look to the following code. As you see the "insert into a list"
at the beginning and end have a total different code-style
OLD:
------------------------------------------------------------------------ switch -regexp -matchvar ARGS $k {
"^(\w+),package$" {
set ::SWITCH [linsert $::SWITCH 0 [lindex $ARGS 1] "return $v" ]
}
"^pattern2package,(\w+)$" {
lappend ::SWITCH [lindex $ARGS 1] "return $v"
}
}
------------------------------------------------------------------------
If you want to use similar coding style for inserting at the beginning
and end, then you can just also use [linsert] to append an element:
set ::SWITCH [linsert $::SWITCH end [lindex $ARGS 1] "return $v"]
Schelte.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)