load extension

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
load extension {from file <filePath> | from data <moduleData>} [ with resource path <resourcePath> ]
Summary

Load a LiveCode Builder extension.

Introduced8.0
Changes

The ability to load multiple modules in a single load extension command was added in LiveCode 9.0.

OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
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 extensions that use resource files (eg 'image from resource file').

Example
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" )
Values
NameTypeDescription
The result

If the load extension command succeeds, the result is empty. Otherwise the result contains an error message describing why the extension could not be loaded.

RelatedCommand: unload extension, create widget
Function: loadedExtensions, result
Glossary: LiveCode Builder extension, command
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.

Tagsextensions