# load_ext proc

Source: https://ref.dm-lang.org/proc/load_ext
Added in BYOND 516.

### Format
> `load_ext(LibName,FuncName)`

### Args
- `LibName`: name of external library ("test.DLL") (note
- `FuncName`: name of function in external library ("func"), which may have prefixes to describe the type of function


### Returns
> A reference to a function in an external library, for use with `call_ext()`.

Use `load_ext()` to pre-load external library functions you intend to use often, when maximum performance is required. (See [call_ext()](https://ref.dm-lang.org/proc/call_ext.md) for the rules for loading libraries.)

The result of this proc can be passed to `call_ext()` as a single argument in lieu of the normal LibName and FuncName.

If the lookup fails for any reason, a runtime error will be thrown.

```dm /load_ext/
var/logfunc

proc/LogLine(msg)
    logfunc ||= load_ext("my_lib", "byond:OutputToLog")
    call_ext(logfunc)(msg)
```

### See also
- [call_ext proc](https://ref.dm-lang.org/proc/call_ext.md)
- [Byondapi](https://ref.dm-lang.org/appendix/Byondapi.md)
