Difference between revisions of "Loadfile"

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>Loads a chunk from the file without execution.
+
Loads a chunk from the file without execution.
 
 
If there are no errors, returns the compiled chunk as a function; otherwise, returns nil plus the error message. The environment of the returned function is the global environment.</translate>
 
 
<source lang="lua">
 
<source lang="lua">
 
(function) = loadfile(filename)
 
(function) = loadfile(filename)
 
</source>
 
</source>
  
=== <translate>Parameters</translate> ===
+
If there are no errors, returns the compiled chunk as a function, otherwise returns nil plus the error message. The environment of the returned function is the global environment.
'''filename''': (string) <translate>name of the file to load</translate> <br/>
+
 
 +
=== Parameters ===
 +
'''filename''': (string) name of the file to load<br/>
  
=== <translate>Return values</translate> ===
+
=== Return values ===
'''<translate>Returns</translate>''' (function) <translate>compiled chunk as a function; otherwise, returns nil</translate><br/>
+
'''Returns''' (function) compiled chunk as a function, otherwise returns nil<br/>
  
 
{{(global)}}
 
{{(global)}}

Revision as of 23:03, 13 May 2022

Available since: Gideros 2011.6
Class: (global)

Description

Loads a chunk from the file without execution.

(function) = loadfile(filename)

If there are no errors, returns the compiled chunk as a function, otherwise returns nil plus the error message. The environment of the returned function is the global environment.

Parameters

filename: (string) name of the file to load

Return values

Returns (function) compiled chunk as a function, otherwise returns nil