[ic] GlobalSub Question

Kevin Walsh kevin at cursor.biz
Wed Apr 25 12:08:14 EDT 2007

"Lars Tode" <lars.tode at bpanet.de> wrote:
> Hi list,
> I need help with GlobalSub.
> I have tried to access the GobalSub test_global_sub, that comes along
> with the interchange.cfg.
> > GlobalSub sub test_global_sub { return 'Test of global subroutine OK.'
> }
> To test that the globalsub is loaded, I added a Require in the
> catalog.cfg
> > Require globalsub test_global_sub "Require of %s %s failed!"
> After restart Interchange, the startup print following message:
> Require of GlobalSub test_global_sub failed!
I just added the exact same GlobalSub line to an interchange.cfg file
(all on one line.  I'm assuming it wrapped in your email).  I also added
the exact same Require line to a catalog.cfg and restarted Interchange.
I didn't get the error message you reported.

You didn't say which Interchange version you're using.  I tried this
on the latest 5.0.0 and it worked.  I wouldn't expect a failure on any
other version either.

If the GlobalSub didn't wrap because of your email client, and you have
it spread over two lines in your interchange.cfg file then I'd expect
problems along the lines of the following:

    Bad GlobalSub 'test_global_sub': Missing right curly or square bracket
    at (eval 307) line 2, at end of line
    syntax error at (eval 307) line 2, at EOF

The only thing I can think of is that the distributed interchange.cfg
file wraps the test GlobalSub in a "ifdef @DEBUG" block.  Check for
the "Sending debug messages to debug.log." message when you start
Interchange.  If you don't get that message then perhaps @DEBUG is
not set.  Scroll to the top of the file and uncomment the "Variable DEBUG 1"

   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

More information about the interchange-users mailing list