Module:OnshokoeseScript: Difference between revisions

From Constructed Worlds Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:


function p.main(frame) -- This block defines the table element p["main"] as a function.
function p.main(frame) -- This block defines the table element p["main"] as a function.
    return getArgs(frame) -- The string result of the function.
local args = getArgs(frame)
return p._main(args)
end -- Ends the block defining the function object p["main"] (or p.main).
end -- Ends the block defining the function object p["main"] (or p.main).



Revision as of 22:40, 25 April 2024

Documentation for this module may be created at Module:OnshokoeseScript/doc

local p = {} -- Defines a variable p as an empty table, but *not* nil.

function p.main(frame) -- This block defines the table element p["main"] as a function.
	local args = getArgs(frame)
	return p._main(args)
end -- Ends the block defining the function object p["main"] (or p.main).

function p._main(args)
	local first = args[1] or ''
	return first
end

return p