if {[string match "*PVT*" $response]}{
regsub -all -- "PVT" $response "" response
set comando [split $response |]
foreach saida $comando { puthelp "PRIVMSG $who: $saida" }
}
what i pretend is to split a long phrase initiated by "PRV" and the point of split is marked with a "|" but this code i only get the first word between any "|" ... whats wrong or how i can resolve this problem ???
You need to provide more info, cause i don't see where do you get the splitchar from. If you are generating it in your regsub, replacing PVT with | then you have a typo there.
Your replace string is "" instead of "|".
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
i have the one string with this 'PVT some text to send | some more text to send | and some more text too'
what i pretend is to remove PVT from string (regsub -all -- "*PVT*" $string "" string) and next split the string by "|" and send to user all the splited strings... something similar to explode () of PHP... but in this code i create... the remove of PVT works ok... but i only get the first word of the splited string...
in the string exemple i wrote before the output gived is something like this:
-some
-some
-and
i pretend something like:
-some text to send
-some more text to send
-and some more text too
i'm very new to TCL ... one day...
i can't figure what i'm doing wrong... logicaly seems correct... i think is some bad utilization of split....