egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

calling a proc from within a proc - SOLVED

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
John_m0wev
Voice


Joined: 02 Jul 2008
Posts: 2

PostPosted: Wed Jul 02, 2008 6:00 am    Post subject: calling a proc from within a proc - SOLVED Reply with quote

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 Sad
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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Jul 02, 2008 10:47 am    Post subject: Re: calling a proc from within a proc Reply with quote

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
View user's profile Send private message
John_m0wev
Voice


Joined: 02 Jul 2008
Posts: 2

PostPosted: Wed Jul 02, 2008 10:38 pm    Post subject: Re: calling a proc from within a proc - SOLVED Reply with quote

Thanks Speechless
Thats solved it


} i always overlook those

many thanks, i feel daft now
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber