Jump to content

Module:Football map

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jts1882 (talk | contribs) at 15:39, 7 May 2018 (create outline module). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

-- All Lua modules on Wikipedia must begin by defining a variable that will hold their
-- externally accessible functions. They can have any name and may also hold data.
p = {}

-- Add a function to the variable. These are callable in Wikipedia via the #invoke command.
-- "frame" will contain the data that Wikipedia sends this function when it is called. 
p.hello = function(frame) 

    -- Declare a local variable and assign data to it.
    local str = "Hello World!"  

    -- Quit this function and send the information in "str" back to Wikipedia.
    -- The "print" function is not allowed, so all output is accomplished via 
    -- returning strings in this fashion.
    return str    

-- End the function.
end

-- All modules end by returning the variable containing its functions to Wikipedia.
return p

-- We can now use this module by calling {{#invoke: HelloWorld | hello }}.
-- The #invoke command begins with the module's name, in this case "HelloWorld",
-- then takes the name of one of its functions as an argument, in this case "hello".