Difference between revisions of "Dofile"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Opens the named file and executes its contents as a Lua chunk.
 
Opens the named file and executes its contents as a Lua chunk.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
dofile(filename)
 
dofile(filename)
 
</source>
 
</source>

Revision as of 15:26, 13 July 2023

Available since: Gideros 2011.6
Class: (global)

Description

Opens the named file and executes its contents as a Lua chunk. <syntaxhighlight lang="lua"> dofile(filename) </source>

When called without arguments, dofile executes the contents of the standard input (stdin).

Returns all values returned by the chunk. In case of errors, dofile propagates the error to its caller (that is, dofile does not run in protected mode).

Parameters

filename: (string) file to execute