PDA

View Full Version : New module not available in script. How to add new modules?


brackebuschtino
05-31-2014, 06:28 PM
Hello,

i am trying to process an HTML string (parse information) with a TCL script. Since i found the module html not being available i downloaded the latest tcllib and extracted the html module as well as its dependency ncgi into the /lib/tcl8.5 folder. However, calling ::html::html_entities gives me the error

invalid command name "::html::html_entities" while executing ...

What am i missing?

Yil
06-03-2014, 01:13 AM
Did you actually take the whole package or just the file? The package provide stuff is needed for TCL to find the library. Did you 'require' the package (I think that's the syntax). I'd take a look at nxTools or ioNiNJA to get an idea of how different authors did things. Poking around the other script files in the lib dir can be interesting as well. And don't forget the tcl website or download the TCL helpfiles/documentation which makes searching locally easier (activestate has a pre-built tcl you can grab the docs out of and open in window's help viewer).

The doc/iTCL.txt file contains the commands and variables added to plain TCL to support ioFTPD specific things, but everything in regular TCL is available for use with the version ioFTPD shipped with.

brackebuschtino
06-03-2014, 05:23 AM
Did you actually take the whole package or just the file?
Actually i took the whole package (i refer to package as the folder named 'html' under 'modules'), but dropped the *.man, *.test and changelog files. The remaining files under /lib/tcl8.5/html are html.tcl and pkgIndex.tcl.
If this is not correct or incomplete, please point me.

In fact its confusing in which folder under /lib to put the extra modules in to since there seem to be different tcl versions considered (i guess). For instance under /lib/tcl8/8.4/platform are files, under /lib/tcl8/8.5 are files and under /lib/tcl8.5. It throws the question why there are two separate tcl8.5 folders and which one to use.

I will check the sources you mentioned