Difference between revisions of "Loadfile"
From GiderosMobile
Line 3: | Line 3: | ||
'''<translate>Available since</translate>:''' Gideros 2011.6<br/> | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> | ||
'''<translate>Class</translate>:''' [[Special:MyLanguage/(global)|(global)]]<br/> | '''<translate>Class</translate>:''' [[Special:MyLanguage/(global)|(global)]]<br/> | ||
+ | |||
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
− | <translate>Loads a chunk from the file without execution. | + | <translate>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> | 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> | ||
Line 10: | Line 11: | ||
(function) = loadfile(filename) | (function) = loadfile(filename) | ||
</source> | </source> | ||
+ | |||
=== <translate>Parameters</translate> === | === <translate>Parameters</translate> === | ||
'''filename''': (string) <translate>name of the file to load</translate> <br/> | '''filename''': (string) <translate>name of the file to load</translate> <br/> | ||
+ | |||
=== <translate>Return values</translate> === | === <translate>Return values</translate> === | ||
'''<translate>Returns</translate>''' (function) <translate>compiled chunk as a function; otherwise, returns nil</translate><br/> | '''<translate>Returns</translate>''' (function) <translate>compiled chunk as a function; otherwise, returns nil</translate><br/> | ||
+ | |||
+ | {{(global)}} |
Revision as of 04:09, 11 February 2020
Available since: Gideros 2011.6
Class: (global)
Description
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.
(function) = loadfile(filename)
Parameters
filename: (string) name of the file to load
Return values
Returns (function) compiled chunk as a function; otherwise, returns nil