I am new to TCL and am struggling with accessing other modules. The SOURCE command helped me include other code that I have written in a TCL program. However, I think I have a problem with accessing libraries of code.
For example, when I reference a math function, it is not found. I think there must be something I need to do to include where the math library is on my computer in the search for a program called via tchsh85.
invalid command name "::math::statistics::mv-ols"
None of these directories exist on my computer: info library= C:/Tcl/lib/tcl8.5 auto_path= C:/Tcl/lib/tcl8.5 C:/Tcl/lib c:/tcl/lib/teapot/package/win32-x86_64/lib c:/tcl/lib/teapot/package/tcl/lib tcl library= C:/Tcl/lib/tcl8.5 auto_index= source C:/Tcl/lib/tcl8.5/word.tcl auto_index= source C:/Tcl/lib/tcl8.5/tm.tcl auto_index= source C:/Tcl/lib/tcl8.5/tm.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/parray.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/package.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/word.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/word.tcl auto_index= source C:/Tcl/lib/tcl8.5/package.tcl auto_index= source C:/Tcl/lib/tcl8.5/tm.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/package.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/tm.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/word.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/package.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/package.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/word.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/auto.tcl auto_index= source C:/Tcl/lib/tcl8.5/history.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl auto_index= source C:/Tcl/lib/tcl8.5/tm.tcl auto_index= source C:/Tcl/lib/tcl8.5/tm.tcl auto_index= source C:/Tcl/lib/tcl8.5/safe.tcl
I received this answer: ::math::statistics is part of TCLlib. To check if you have it installed, type
package require tcllib and if it is installed, it will tell you the version number. If it's not installed, you can use Teacup to install it for you.
I tried the code:
catch {package require nonexistentName}
package names
puts "[package names]"
and I received:
Thread logger img::pixmap TclOO tablelist_tile struct::tree opt tcltest img::ico img::pcx struct::set msgcat pngtcl tablelist::common ftp Tclx trsync tdom img::sgi report comm dde Mk4tcl img::sun img::gif img::window textutil cmdline csv img::tga Img img::png Tktable Itk Ttrace tipstack zlibtcl img::base platform fileutil Tk vfs ActiveTcl http tbcload Memchan style struct::graph tablelist treectrl struct::queue img::jpeg activestate::teapot::link img::bmp registry jpegtcl tdomhtml tooltip snit img::ppm struct::stack tcl::tommath img::tiff tls widget struct img::xpm md5 BWidget img::xbm log starkit Tcl Trf tifftcl Itcl img::ps sqlite3 base64 trofs
0.7
I may not understand TCL but in other languages I have used, there a way to set up a list of directories or files to be searched in a certain order for called code. It seems to me that I need to tell tclsh85 where to look.
I downloaded tcl 8.5.13 and BWidget 1.9.6 from ActiveState I installed tcl and I unpacked BWidget on my computer, but it is in a different location than my tcl programs. Is math part of that? If not, what should I download? As I am running on Windows Vista, I prefer to just get an executable version rather than something that I need to build. I can create tcl programs and as long as they are self contained or if I can use SOURCE, all is well. Where I am having trouble is calling code outside my program.
I worry that auto_path needs to be set up for my environment as it does not correspond to anything on my computer now.
Please answer assuming I do not know anything about how tcl works. I am trying to teach myself (with some help from internet documentation and people who will answer questons).
Thank you.