Purpose:Create, modify, delete, or display library functions

 

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

 

/D(elete)/Q (no errors)
/F (display functions)/R(ead functions)
/P(ause)/U(pdate functions)

 

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-RT starts, it will automatically load any library function files in the LIBRARY subdirectory of the TCC-RT 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-RT from loading library function files at startup with the TCC-RT /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-RT will use the first matching function name it finds in the library list.

 

The TCC-RT 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-RT startup option /IL will prevent loading the default library functions (from the Library folder).

 

Prefixing a command name with a * will ignore alias and library function name matches.

 

Options:

 

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

 

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

 

/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)