sergelaurent
Technical User
I have some new commands!!!! I want to add them to tcl list of commands so that they can be recognised as such when using them on an interpreter!!!! (ex:tclsh). How can I do that?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
source <[red]script file[/red]>
auto_mkindex <[red]library directory[/red]> <[red]script file[/red]>
lappend auto_path <[red]library directory[/red]>
load - Load machine code and initialize new commands.
SYNOPSIS
load fileName
load fileName packageName
load fileName packageName interp
DESCRIPTION
This command loads binary code from a file into the application's address space and calls an initialization procedure in the package to incorporate it into an interpreter. fileName is the name of the file containing the code; its exact form varies from system to system but on most systems it is a shared library, such as a .so file under Solaris or a DLL under Windows. packageName is the name of the package, and is used to compute the name of an initialization procedure. interp is the path name of the interpreter into which to load the package (see the interp manual entry for details); if interp is omitted, it defaults to the interpreter in which the load command was invoked.
Once the file has been loaded into the application's address space, one of two initialization procedures will be invoked in the new code. Typically the initialization procedure will add new commands to a Tcl interpreter. The name of the initialization procedure is determined by packageName and whether or not the target interpreter is a safe one. For normal interpreters the name of the initialization procedure will have the form pkg_Init, where pkg is the same as packageName except that the first letter is converted to upper case and all other letters are converted to lower case. For example, if packageName is foo or FOo, the initialization procedure's name will be Foo_Init.