/LOAD [-q] file
/REQUIRE [-q] file

/LOADED token

/Load and /require both read and execute commands from file. They are identical, except that if file calls /loaded and has already been read once, /require will not read it again (but the LOAD message/hook will still be displayed/called).

"/Loaded token" should be the first command in a file that is designed to be loaded only once with /require. Token should be a string that does not contain space or glob metacharacters, and is different than the token used by any other /loaded call. The file's full name is usually a good choice for token.


Do not echo the "% Loading commands from file" message in this /load call or any /load calls in file. (but the LOAD hook will still be called).

The file may contain any legal TinyFugue commands. Blank lines and lines beginning with ';' are ignored. Any leading whitespace on a line is stripped. Any line ending in '\' will have the following line joined to it (after leading spaces are stripped). A '%' preceding a '\' eliminates its special meaning.

The file name is expanded as described under "filenames".

If the COMPRESS_SUFFIX and COMPRESS_READ macros are defined, the file will be automatically uncompressed if needed.

If the expanded filename is not an absolute path name, TF will search first in the current directory (which can be changed with /lcd), and then in the list of directories named by %{TFPATH}. If %{TFPATH} is blank or unset, the single directory named by %{TFLIBDIR} is used.

A /load may be aborted early with the /exit command in the file.

Loaded files may be given any name, but names ending in ".tf" are recommended.

/Load and /require return 1 if successful (for /require, this includes not needing to read the file), or 0 if not successful. /Loaded does not return if the file that calls it has already been loaded.

The standard macro library also defines the commands /loaddef, /loadbind, /loadhilite, /loadgag, /loadtrig, /loadhook, and /loadworld. These macros will load from a default file if no file is specified.

See: macros, library, /exit, /def, /save, /lcd, filenames, compression

Back to index
Back to tf home page
Copyright © 1995 - 1999 Ken Keys