This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

global procs (different files)

Old posts that have not been replied to for several years.
Locked
e
eiSi
Halfop
Posts: 70
Joined: Thu Mar 07, 2002 8:00 pm

global procs (different files)

Post by eiSi »

hi there!

Is it possible to use procs from an other tcl file?

For Example:

file1:
proc blub {blub blubb} { putmsg $chan "blub" }

file2:
proc asd {asd asdd} {
global blub
blub a b
}

or something like this?
I think you got the point. :)

Thanks for any help!
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes.

The source command simply loads a file, into the global memory namespace.

If your example, you use the global command in the proc. There is no need to do this. The global command is to import variable names, that exist globaly, so they may be used localy (which they are not).
l
laidas
Voice
Posts: 18
Joined: Thu Jul 25, 2002 10:07 am

Yes

Post by laidas »

Yes. in the config file is wrote:

source scripts/script.tcl - it means that this tcl file will be in use. And binds, procs and other [censored] will be active, cause you use not one tcl script, and eggdrop sees them all, so be smart ;)
and it is no need to write global ..., cause global command takes only variables and arrays to proc.
e
eiSi
Halfop
Posts: 70
Joined: Thu Mar 07, 2002 8:00 pm

Post by eiSi »

all right, thx!

I'll try it!

ps: really fast help!!! :D
l
laidas
Voice
Posts: 18
Joined: Thu Jul 25, 2002 10:07 am

:)

Post by laidas »

You`re welcome ;)
Locked