set test "some text | some more text | and even more text |"
set test [cleanarg $test]
set oga ""
foreach t $test {
if {$t != "|"} {
if {$oga == ""} {
set oga $t
} else {
set oga "$t $oga"
}
} else {
putserv "privMSG #somechan :$oga"
set oga ""
}
}
proc cleanarg {arg} {
set temp ""
for {set i 0} {$i < [string length $arg]} {incr i} {
set char [string index $arg $i]
if {($char != "12") && ($char != "15")} {
append temp $char
}
}
set temp [string trimright $temp "}"]
set temp [string trimleft $temp "{"]
return $temp
}
The cleanup proc seperates each word.
_________________
Searchig
One clueless user
<font size=-1>[ This Message was edited by: Searchig on 2002-06-02 18:42 ]</font>
thats a very convoluted way of doing it. personally I'd just split it into a list using | as the seperator, and run a for loop through it
something like
set blah [split $instring |]
for {set x 0} {$x == [llength $blah]} {incr x} {
putserv "PRIVMSG $chan :[lindex $blah $x]"
}