TCL error [pub:addREQ]: invalid command name "else"

Old posts that have not been replied to for several years.
Locked
I
Ixje

Post by Ixje »

After reading a tutorial i tried to create my first script (see below) it does the adding but keeps saying -> TCL error [pub:addREQ]: invalid command name "else"

Anybody sees what i did wrong or what i forget? Thnx :>

bind pub - !addREQ pub:addREQ

proc pub:addREQ {nick uhost hand chan REQ} {
global REQdir
if {$REQ != ""} {
set fs [open REQ.db w]
puts $fs "$REQ"
puthelp "NOTICE $nick : $REQ added to request list"
close $fs
}
else {
puthelp "NOTICE $nick :!addREQ <requested file>"
}
}
S
Stafford

Post by Stafford »

I suppose it's like this...
close $fs
} else {
puthelp "NOTICE $nick :!addREQ <requested file>"
}
}
Hope this helps.
I
Ixje

Post by Ixje »

thnx :smile:
Locked