Difference between revisions of "Require"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
Loads and runs libraries. Roughly, `require` does the same job as `dofile`, but, `require` searches for the file in a path. Because of that, `require` is the preferred function in Lua for loading libraries.
+
<translate>Loads and runs libraries. Roughly, [[[require` does the same job as `dofile`, but, `require` searches for the file in a path. Because of that, `require]]] is the preferred function in Lua for loading libraries.</translate>
 
<source lang="lua">
 
<source lang="lua">
 
  require(packagename)
 
  require(packagename)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''packagename''': (string) library to load <br/>
+
'''packagename''': (string) <translate>library to load</translate> <br/>

Revision as of 13:32, 23 August 2018

Available since: Gideros 2011.6

Description

Loads and runs libraries. Roughly, [[[require` does the same job as `dofile`, but, `require` searches for the file in a path. Because of that, `require]]] is the preferred function in Lua for loading libraries.

 require(packagename)

Parameters

packagename: (string) library to load