load

From ComputerCraft
Jump to navigation Jump to search

load
Function
Syntax
load()
Returns function or nil
API Base globals
Source CC:Tweaked

Loads chunk ld (or, if ld is a function, loads the chunk returned by it) as a function and returns it. Error messages use source if available, or a representation of ld.

ExampleExampleLoading a string
Prints "Hello World" from a loaded function
Code
load("print('Hello World')")()
Output Hello World