Forum OpenACS Q&A: using Package Command..

Posted by Jerome M on
i have a page tcltest.tcl and tcltest.adp i added

package require TGDChart

but it caused an error? are they ways on  loading this package.... i need this for graphing some charts..

[05/Mar/2003:16:38:17][12149.4101][-conn1-] Error: GET /tcltest  can't find package TGDChart
    while executing
"package require TGDChart"
    ("uplevel" body line 2)
    invoked from within
"uplevel {
          package require TGDChart

set sd [dt_widget_datetime -default now start seconds]

Posted by Robert Locke on
I recall once trying "package require", failing miserably, and resorting to "load /path/to/", which worked.

Relatedly, you might also want to create a separate package called "tgdchart" (or whatever) containing a single "tgdchart-init.tcl" file which simply loads "".  You could make the location of a parameter as well.

Hope this helps...

Posted by Jamie Rasmussen on
You could try the workarounds here:

Or, "package require" is supposed to work out of the box with AOLserver 4. I just tried loading a package from tcllib and it seems to.

Also, there used to be a module for AOLserver called ino_chart that was an interface to GDChart. Its author abandoned it, but someone around here might have a copy you could try.

Posted by Roberto Mello on
When I had to use tgdchart, I resorted to using load. I'm so glad AOLserver 4 deals with package require without the need for extra hacks.

There are alternatives to tgdchart though. This thread talks about them with examples included: