Code: Select all
bind pubm - * test:proc
proc test:proc {nick uh hand chan arg} {
global mylist
lappend mylist "[split $arg]"
}
Code: Select all
proc writefile {} {
gloabl mylist
set fp [open "some.file" w]
foreach a $mylist {
puts $fp "[join $a]"
}
}
OK!% set h ""
% lappend h "heya peeps "
{heya peeps }
% lappend h ";)"
{heya peeps } {;)}
% lappend h test
{heya peeps } {;)} test
% lappend h test again
{heya peeps } {;)} test test again
% lappend h {and some more }
{heya peeps } {;)} test test again {and some more }
lappend h {j {;)}}
{heya peeps } {;)} tes test again {and some more } {j {;)}}
So lets do it the proper way% foreach a $h { puts stdout $a }
heya peeps
test
test
again
and some more
j {;)}
NOTE: the use of "join" in the last outout, it made sure the {;)} became% foreach a $h { puts stdout [join $a] }
heya peeps
test
test
again
and some more
j
Code: Select all
proc pub_blabla {nick uhost hand chan strrr} {
set str [split $strrr]
lappend botarray $str
...
proc save_blabla {} {
set fff [open "some_file" w]
foreach n $botarray {
puts $fff " "[join $n]""
}
this is the equvilant of "Stab myself in heart to see if there is a knife in my heart.if { [lsearch $botarray [lindex $botarray $n]] >= $n } {