require | |||||||
Type | command | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Summary | Executes the given script in the context of the global environment. | ||||||
Introduced | 4.6.3 | ||||||
OS | mac, windows, linux | ||||||
Platforms | server | ||||||
Parameters |
| ||||||
Example |
| ||||||
Related | Command: include | ||||||
Description | Executes the given script in the context of the global environment, but only if it has not previously been included or required. This is the same as the include command in operation, except it makes it easy to implement 'include-once' files and is designed primarily for library scripts. Scripts are parsed in full before being executed, with any handler and variable definitions being added to the home stack environment before any commands placed at global scope are executed. These are ordered by encounter in the file. As require is a command, the parse-before-execute effect only extends as far as the end of the current file.
|