« Introduction au Lua/Modules » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 36 :
== Understand Your Lua Script ==
To understand your Lua script:
# Notice that the <code>function name forp.hello()</code> theadds firsta function isnamed ''<code>hello'':</code>.
#: <code>function p.hellomeet()</code> adds a function named <code>meet</code>.
#: <code><nowiki>{{#invoke:Sandbox|hello}}</nowiki></code> calls the Sandbox module <code>hello</code> function.
# Notice that the function name for the second function is ''meet'':
#: <code><nowiki>{{#invoke:Sandbox|meet}}</nowiki></code> calls the Sandbox module <code>meet</code> function.
#: <code>p.meet()</code>
# Notice that the first <nowiki>#invoke</nowiki> calls the ''hello'' function:
#: <code><nowiki>{{#invoke:Sandbox|hello}}</nowiki></code>
# Notice that the second <nowiki>#invoke</nowiki> calls the ''meet'' function:
#: <code><nowiki>{{#invoke:Sandbox|meet}}</nowiki><code>
Each Lua module can contain one or more functions that may be called individually.