include

include

include

Function

Import and execute BT files during runtime, and return the explicit return or exit values of the imported files.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
pathStringYesNoneThe path of the BT file to be imported.

Return value

TypeDescription
Any/EmptyThe corresponding value is returned when the include file is executed to return or exit; Empty is returned at the end of normal execution.

Example

Notes

  • The path is parsed according to the current source code directory and project root rules.
  • The include file will be compiled and cached, but the target file will be executed every time it is called.
  • Function declaration will enter the current VM global environment.
  • Bracketless syntax only supports statement form; please use include(path) when you need to assign the return value to a variable.