Tool Command Language: 7.2 Using a New Command: Autoloading

Up: GEOS SDK TechDocs | Up | Prev: 7.1 Compilation | Next: 7.3 Explicit Loading

If the development environment has been set up properly, there should already exist the /pcgeos/Tools/swat/lib directory on the workstation. This directory will contain all of the code files for the built-in Swat commands. To autoload a new command, copy its code file to the /pcgeos/Tools/swat/lib directory and add its name to the autoload. tcl file in the directory. This will load the command into Swat every time Swat is started. For example, say the command blitzburp has just been written to examine a new data structure. First, copy the file containing its code (say blitz. tcl) into the /pcgeos/Tools/swat/lib directory. Next, edit the autoload. tcl file and add one of the following lines:

[autoload blitzburp 0 blitz]
[autoload blitzburp 1 blitz]

This will ensure that blitz.tcl will be loaded when the command blitzburp is first used. The 0 indicates that the command must be typed exactly, and the 1 indicates that the interpreter will not evaluate arguments passed to the command. (Full reference information is available for the autoload command.)


Up: GEOS SDK TechDocs | Up | Prev: 7.1 Compilation | Next: 7.3 Explicit Loading