first previous next last contents

The tclIndex file

One final requirement before the Tcl dialogue is complete is to create the `tclIndex' file.

Tcl uses a method whereby Tcl files are only loaded and executed when a command is first needed. This is done by referencing auto_index array in the Tcl error handler. This handler requires the `tclIndex' files to determine the location of each command. Failing to create this file will cause Tcl to complain that a command does not exist.

To create a `tclIndex' file start up either stash or tclsh and type 'auto_mkindex dir' where dir is the name of the directory (often simply ".") containing the Tcl files. For the composition package this created the following `tclIndex' file.

# Tcl autoload index file, version 2.0
# This file is generated by the "auto_mkindex" command
# and sourced to set up indexing information for one or
# more commands.  Typically each line is a command that
# sets an element in the auto_index array, where the
# element name is the name of a command and the value is
# a script that loads the command.

set auto_index(Composition) [list source [file join $dir composition.tcl]]
set auto_index(Composition2) [list source [file join $dir composition.tcl]]

first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.
URL: http://www.mrc-lmb.cam.ac.uk/pubseq/manual/scripting_209.html