This HTML5 document contains 5 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
dctermshttp://purl.org/dc/terms/
n4http://dbkwik.webdatacommons.org/ontology/
n2http://dbkwik.webdatacommons.org/resource/dGDjCA-jIyIqD_WotjOW0g==
n8http://dbkwik.webdatacommons.org/resource/vC3SdCdRbmQgkBRnxCl_Lw==
rdfshttp://www.w3.org/2000/01/rdf-schema#
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n7http://dbkwik.webdatacommons.org/wowwiki/property/
xsdhhttp://www.w3.org/2001/XMLSchema#
n6http://dbkwik.webdatacommons.org/resource/AQbV7qI985vrMiprOeL8gg==
Subject Item
n2:
rdfs:label
Function arguments
rdfs:comment
Functions can have arbitrarily defined arguments defined in the opening line and subsequently used within the body of the function. Your parameters can be called any valid Lua name. Below is a simple function without arguments, followed by another function that calls on the first: function MyAddon_Mimic() DEFAULT_CHAT_FRAME:AddMessage("Hello World!") end function MyAddon_Call() MyAddon_Mimic() end Now the same function with arguments (you can define any number of arguments):
dcterms:subject
n6:
n7:wikiPageUsesTemplate
n8:
n4:abstract
Functions can have arbitrarily defined arguments defined in the opening line and subsequently used within the body of the function. Your parameters can be called any valid Lua name. Below is a simple function without arguments, followed by another function that calls on the first: function MyAddon_Mimic() DEFAULT_CHAT_FRAME:AddMessage("Hello World!") end function MyAddon_Call() MyAddon_Mimic() end Now the same function with arguments (you can define any number of arguments): function MyAddon_Mimic(arg1) DEFAULT_CHAT_FRAME:AddMessage("Hello " .. arg1) end function MyAddon_Call() MyAddon_Mimic("Buddy!") end Whereas the first example would've simply printed "Hello World!" to the chat window, the second example will now print "Hello Buddy!" However, arg1 is a pretty non-discriptive argument name (and we only used one). Let's try something more interesting: function MyAddon_Mimic(who, send) local posX, posY = GetPlayerMapPosition(who); if send==1 then DEFAULT_CHAT_FRAME:AddMessage(who .. " is currently at location " .. posX .. "," .. posY) end end function MyAddon_Call() MyAddon_Mimic("player", 1) MyAddon_Mimic("party1", 1) MyAddon_Mimic("party2", 0) end Here, our little addon will now print the location of our player and our first party member, but while it will get the location of party member 2, it won't print it.