Please enable JavaScript to view this site.

Take Command / TCC Help v. 28

Navigation: TCC > Commands

LIBRARY

Scroll Prev Top Next More
Purpose:Create, modify, delete, or display library functions

 

Format:LIBRARY [/= /D func /F [func] /N /P[n] /Q /R file ... /U] [command line]

 

/P(ause)

 

Usage:

 

LIBRARY will load / display / delete library functions, which are similar to batch files but which are loaded into RAM and can be called as if they are internal commands. Library functions are read from files, with the syntax:

 

functionname {

command1

command2

...

}

 

The opening brace { must be on the same line as the function name (separated by a space), and the closing brace } must be on a line by itself.

 

When TCC starts, it will automatically load any library function files in the LIBRARY subdirectory of the TCC installation directory. You can specify a different location by setting the LibraryDirectory INI directive. You can have any number of functions in a file.

 

You can prevent TCC from loading library function files at startup with the TCC /IL option.

 

If you do not specify any switches, LIBRARY will display the library function names that match the command line argument(s). If you do not specify any arguments, LIBRARY will display all of the library function names.

 

The command line following the library function name is passed to the function, and the arguments can be referenced with the same %1 - %n syntax as used by batch files and aliases.

 

Library functions can call aliases, internal or external commands, batch files, or other library functions.

 

You can specify which library to use for a function name (allowing you to use the same function names in different libraries). To specify a particular library and function, use the syntax:

 

library$function

 

Where library is the library file name, and function the name of the function.

 

If you don't specify a library name, TCC will use the first matching function name it finds in the library list.

 

The TCC parser will look for a matching library function name before looking for plugins, internal commands, external commands, or batch files. The command line following the library function name is passed to the function, and the arguments can be referenced with the same %1 - %n syntax as used by batch files and aliases.

 

The TCC startup option /IL will prevent loading the default library functions (from the Library folder).

 

Options:

 

/=Display the LIBRARY command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.

 

/DDelete a function (the function name can contain wildcards)

 

/FDisplay the loaded (matching) functions (the function name can contain wildcards)

 

/NLIBRARY with no arguments will display the function names in the library list. If you specify /N and no other arguments, LIBRARY will show the library name + function name in the library$function format.

 

/P[n]Pause after each page when displaying functions. Your options at the prompt are explained in detail under Page and File Prompts. The /P option has an optional argument n that specifies the number of seconds to wait for a keystroke before continuing.

 

/QDon't display an error if deleting or updating functions that don't exist

 

/RRead function files. You can use multiple files with one LIBRARY /R command by placing the names on the command line, separated by spaces:

 

library /r function1.lst function2.lst

 

/UUpdate function (otherwise you will get an error when loading a function that already exists)