Code: Select all
set brackets [list]
set pipes [list]
set normal [list]
foreach nick $nicklist {
set fc [string index $nick 0]
if {$fc == {[} || $fc == {]}} {
lappend brackets $nick
} elseif {$fc == "|"} {
lappend pipes $nick
} else {
lappend normal $nick
}
}
set nicklist [concat $normal $brackets $pipes]
Code: Select all
proc mircsort {list} {
return [lsort -command mircsortproc $list]
}
proc mircsortproc {f s} {
set map [list \[ \250 \] \251 \| \252]
set f [string map $map $f]
set s [string map $map $s]
return [string compare $f $s]
}