Skip to main content

include

Type

command

Summary

The include command executes the given script in the context of the global environment.

Syntax

include <path>

Description

Use the include command to load scripts contained in other files.

Include is only available when running in CGI mode (Server).

note

LiveCode server scripts do not require specific file extensions. Common extensions used include ".irev" and ".lc".

Note: Upon include a script is loaded into memory and parsed. Any variables and handler definitions are added to the global (script) environment. Then, each command/function is executed in order as it is encountered in the file.

Note: The behavior of the include command is identical regardless of where it is run from; e.g. if it is run from a handler in a stack, it only affect the global script environment (home stack).

Parameters

NameTypeDescription

path

enum

The path to the file containing the script to include.

  • An absolute path to the file. For example "/home/user/www/scripts/foo.lc".
  • A relative path to the file. Relative paths are resolved relative to the current folder. For example "includes/foo.lc" where folder 'includes' is in the current folder.

Examples

include "includes/foo.lc"
include "/home/mark/www/scripts/foo.lc"

glossary: absolute file path, relative file path, CGI, defaultFolder, global

Compatibility and Support

Introduced

LiveCode 4.6.3

OS

mac

windows

linux

Platforms

server

Thank you for your feedback!

Was this page helpful?