Module:Static/doc

From Modded Wiki
Jump to navigation Jump to search

This is the documentation page for Module:Static

This is the documentation page. It is transcluded into Module:Static. See Template:Documentation for more information.

Usage

This module returns a table that can store data that persists in between multiple {{#Invoke:}} calls.

Example:

local p = {}

function p.main()
    local static = require('Module:Static')
    static.x = (static.x or 0) + 1
    return static.x
end

return p

If the above code sample was stored in Module:foo and then {{#Invoke:foo|main}} {{#Invoke:foo|main}} would result in 1 2.


zh:Module:Static/doc