Dear Key,
the normal way to organize this is to use packages, namespaces and a
pckIndex.tcl file.
Then, you put your folder with the pckIndex.tcl file into your auto_path
search list.
There is a couple of explanation required here and Ashoks book may help
to get the basics.
What I do:
- my program has a main folder, which is relative to the start script.
- Say, your start script is somewhere, and all other folders are in
subfolder "lib".
- So add in the start script:
lappend auto_path [file join [file dirname [info script]] lib]
This command will automatically cause a scan for pckIndex.tcl files in
the given folder and all direct sub-folders.
The pckIndex.tcl file has an entry for each package in the same folder,
like this:
-pckIndex.tcl---
package ifneeded tools 1.0 [list source -encoding utf-8\
[file join $dir tools.tcl]]
-EOF-
A package "tools" with Version 1.0 is in the file tools.tcl
-tools.tcl- has the following
package provide tools 1.0
% program code
-EOF-
And the start script does this to load the package:
package require tools
It is common, that the package tools will reside in the namespace "tools".
If you have any other packages (3rd party), just put them also in your
lib folder and get them by package require.
Sorry, this does not answer your question directly,
Harald