Difference between revisions of "Dofile"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[(global)]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/(global)|(global)]]<br/>
 
  
=== <translate>Description</translate> ===
+
=== Description ===
<translate>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).</translate>
+
Opens the named file and executes its contents as a Lua chunk.
 
<source lang="lua">
 
<source lang="lua">
 
dofile(filename)
 
dofile(filename)
 
</source>
 
</source>
  
=== <translate>Parameters</translate> ===
+
When called without arguments, ''dofile'' executes the contents of the standard input (stdin).
'''filename''': (string) <translate>file to execute</translate> <br/>
+
 
 +
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/>
  
 
{{(global)}}
 
{{(global)}}

Revision as of 22:51, 13 May 2022

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