Load a LiveCode Builder extension.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 8.0 Security:
# Syntax
load extension {from file filePath | from data moduleData} [ with resource path resourcePath ]
# Params
- filePath : The path to a compiled <LiveCode Builder extension> file. - moduleData : Binary data that constitutes a valid compiled <LiveCode Builder extension>. - resourcePath : The path to use for any operations in the <LiveCode Builder extension|extensions> that use resource files (eg 'image from resource file').
# Examples
load extension from file "packaged_extensions/com.livecode.widget.navbar/module.lcm" if the result is empty then create widget "My Navbar" as "com.livecode.widget.navbar" end if
local tExtensionData put url ("binfile:" \ & tMyExtensionFolder & slash & "module.lcm" ) into tExtensionData load extension from data tExtensionData with resource path (tMyExtensionFolder \ & slash & "resources" )
# Description
Use the load extension command to load a LiveCode Builder extension. If the extension is a library, its public handlers will be added to the bottom of the message path. If it is a widget, it will be available as a control in the tools palette to drag out, or to create with the create widget command.
If the moduleData or the data loaded from filePath contains more than one LiveCode Builder module, then the first module is treated as the extension's main module and the remaining modules are treated as support modules. Support modules are only kept loaded if they are used by the main module. Support modules' names must begin with the name of the main module.
# Tags
# See
- **command:** unload extension, create widget - **function:** loadedExtensions, result - **glossary:** LiveCode Builder extension, command