Site Notice
hello, world
Difference between revisions of "Module:Variable"
From Project-EPB Commons
(Created page with "local p = {} variable = variable or 1 function p.main() return variable end variable = variable + 1 return p") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
− | variable = variable or 1 | + | _G.variable = _G.variable or 1 |
− | function p.main() | + | function p.main(frame) |
− | return | + | local n = _G.variable |
+ | _G.variable = _G.variable + 1 | ||
+ | return n | ||
end | end | ||
− | |||
− | |||
return p | return p |
Latest revision as of 18:07, 29 October 2020
{{#invoke:variable|main}}{{#invoke:variable|main}}{{#invoke:variable|main}}
1 1 1
local p = {}
_G.variable = _G.variable or 1
function p.main(frame)
local n = _G.variable
_G.variable = _G.variable + 1
return n
end
return p