| View previous topic :: View next topic |
| Author |
Message |
John_m0wev Voice
Joined: 02 Jul 2008 Posts: 2
|
Posted: Wed Jul 02, 2008 6:00 am Post subject: calling a proc from within a proc - SOLVED |
|
|
When my script starts, it goes into a proc
Upon the result of $result being either 1 or 0 it should call another proc
it aint
can someone put me on the right track.
| Code: |
set sql "SELECT username FROM users WHERE username = '$sgnick' "
putloglev d * "ircstats: executing $sql"
set result [mysqlsel $db_handle $sql ]
if {$result == 1} {
putquick "PRIVMSG #mods-lounge : Check 1 "
disp_mods $sgnick
} else { putlog "calling ghstcheck proc"
ghst_check $ghostnick }
proc disp_mods { sgnick } {
blah blah
proc ghst_check { ghostnick } {
blah blah
|
the error i recieve is this -
Tcl error [regcheck]: invalid command name "ghst_check"
and
Tcl error [regcheck]: invalid command name "disp_mods"
Last edited by John_m0wev on Wed Jul 02, 2008 10:39 pm; edited 1 time in total |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed Jul 02, 2008 10:47 am Post subject: Re: calling a proc from within a proc |
|
|
| Code: | ; # up here is hopefully your bind and procedure header
set sql "SELECT username FROM users WHERE username = '$sgnick' "
putloglev d * "ircstats: executing $sql"
set result [mysqlsel $db_handle $sql ]
if {$result == 1} {
putquick "PRIVMSG #mods-lounge : Check 1 "
disp_mods $sgnick
} else {
putlog "calling ghstcheck proc"
ghst_check $ghostnick
}
} ;# this is your missing closing brace, you must close the procedure
proc disp_mods { sgnick } {
# blah blah
} ; # again, you forgot to close the procedure
proc ghst_check { ghostnick } {
# blah blah
} ; # again, you forgot to close the procedure
|
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
John_m0wev Voice
Joined: 02 Jul 2008 Posts: 2
|
Posted: Wed Jul 02, 2008 10:38 pm Post subject: Re: calling a proc from within a proc - SOLVED |
|
|
Thanks Speechless
Thats solved it
} i always overlook those
many thanks, i feel daft now |
|
| Back to top |
|
 |
|