Code: Select all
proc sortit {text} {
set list [split $text ", "]
set list [lsort -dictionary $list]
return [string trimright [join $list ", "] ", "]
}
Code: Select all
proc sortit {text} {
regsub -all -- {\,\.\@\;\:\\} $text { } text
foreach a [split $text] {
if {$a != ""} { lappend list $a }
}
return [string trimright [join [lsort -dictionary $list] ", "] ", "]
}
Code: Select all
set list [split $text ", "]
set list [lsort -dictionary $list]
Code: Select all
set list [lsort -dictionary $text]
near the start of your procedure...caesar wrote:Thanks again. Is there a way I can see in how many seconds the creation of the list took?
Code: Select all
set starttime [clock seconds]
Code: Select all
set stoptime [clock seconds]
set totaltime [expr $stoptime - $starttime]
Code: Select all
set length [string length [lindex [split $item "/"] [expr [llength [split $item "/"]] - 1]]]