Functions Index :: L :: LoadModule

[<< up one level]

Module:

:: loader

Definition:

LoadModule(string library, string package, string module)

Description:

Loads the specified module making its code and global data available to scripts.[1]

In coopearion with DefineModule ensures that the module is loaded just once.

Arguments:

library: The name of the library where the module belongs (is part of).

package: The name of the package where the module belongs.[2]

module: The name of the module.

Notes and conditions on arguments relations:

Third party libraries must be structured in a way similar to AVSLib for this function to be interoperable (see the "Using the loader module to build Avisynth script libraries" backgrounder).

Examples:

"

dummy = LoadModule("avslib", "numeric", "rounding")

dummy = LoadModule("avslib", "array", "core")

 

[<< top]

 


[1]: User code must assign the return value of the function to a dummy variable if the last special Avisynth global variable is used by the script. Else, last will be the function's return value (usually not a clip and in any case not the clip intended by the script writer).

This is of concern if the call to the function is made at the middle or near the end of the script and the script's coding style makes use of the implicit assignment to last (ie filter / function calls do not assign their value to a variable).


[2]: The package may be further divided to an unlimited hierarchy of subpackages, if each level is separated by the "/" (slash) character.

Each slash character corresponds to a path separator in the underlying OS, thus to a nested subfolder in the package tree.

The following examples illustrate the concept: