Difference between revisions of "Dofile"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Opens the named file and executes its contents as a Lua chunk. When called without arguments, dofile e...")
 
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[(global)]]<br/>
 +
 
=== Description ===
 
=== Description ===
Opens the named file and executes its contents as a Lua chunk. 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).
+
Opens the named file and executes its contents as a Lua chunk.
<source lang="lua">
+
<syntaxhighlight lang="lua">
= dofile(filename,)
+
dofile(filename)
</source>
+
</syntaxhighlight>
'''filename:''' (string) file to execute ''''''<br/>
+
 
 +
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<br/>
 +
 
 +
=== See also ===
 +
'''[[Loadfile]]'''
 +
 
 +
{{(global)}}

Latest revision as of 04:10, 2 December 2023

Available since: Gideros 2011.6
Class: (global)

Description

Opens the named file and executes its contents as a Lua chunk.

dofile(filename)

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

See also

Loadfile