Difference between revisions of "User:Demonnic"

From Mudlet
Jump to navigation Jump to search
Line 1: Line 1:
<syntaxhighlight>
+
=Proposed template for lua functions
for k,v in pairs(_G) do
 
  echo("ack!")
 
end
 
</syntaxhighlight>
 
  
 +
 +
==functionName==
 +
;functionName(arg1, arg1)
 +
: What the function does.
 +
: See also: [[Manual:Lua_Functions#paste|paste]]
 +
<br/>
 +
 +
;Parameters
 +
* arg1:
 +
: What arg1 is/does. Passed as a string.
 +
* arg2:
 +
: What arg2 is/does. Passed as a string.
 +
<br/>
 +
 +
;Usage
 
<lua>
 
<lua>
for k,v in pairs(_G) do
+
--a small example snippet of the function in action
  echo("ack!")
+
--the comments up top should introduce it/explain what the snippet does
end
+
functionName("arg1", "arg2")
 
</lua>
 
</lua>

Revision as of 07:47, 12 June 2011

=Proposed template for lua functions


functionName

functionName(arg1, arg1)
What the function does.
See also: paste


Parameters
  • arg1:
What arg1 is/does. Passed as a string.
  • arg2:
What arg2 is/does. Passed as a string.


Usage

<lua> --a small example snippet of the function in action --the comments up top should introduce it/explain what the snippet does functionName("arg1", "arg2") </lua>