Difference between revisions of "Require"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''<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>Description</translate> === | === <translate>Description</translate> === | ||
− | <translate>Loads and runs libraries. Roughly, | + | <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) |
Revision as of 09:27, 24 August 2018
Available since: Gideros 2011.6
Class: (global)
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