Module:ShowArguments: Difference between revisions
Appearance
Content deleted Content added
Salix alba (talk | contribs) join |
Salix alba (talk | contribs) a |
||
Line 7: | Line 7: | ||
/* |
/* |
||
*/ |
*/ |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
]] |
]] |
||
Line 32: | Line 39: | ||
function ShowArguments.join(frame) |
function ShowArguments.join(frame) |
||
local res=''; |
local res=''; |
||
local args = frame.args; |
|||
local args = frame.args |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
local sep = args[1]; |
local sep = args[1]; |
||
res = table.concat( args, sep, 2, j ) |
res = table.concat( args, sep, 2, j ); |
||
return res |
return 'sep (' .. sep ..')' .. res |
||
end |
end |
||
Revision as of 12:07, 16 July 2013
--[[
ShowArguments
Displays all the arguments passed into the module
Usage:
{{ Invoke:ShowArguments | display }}
/*
*/
if args[1] == nil then
local pFrame = frame:getParent();
args = pFrame.args;
for k,v in pairs( frame.args ) do
args[k] = v;
end
end
]]
local ShowArguments = {}
function ShowArguments.display(frame)
local text='';
globalFrame = frame
local args = frame.args
if args[1] == nil then
text = 'Arguments from parent'
local pFrame = frame:getParent();
args = pFrame.args;
for k,v in pairs( frame.args ) do
args[k] = v;
end
end
for k,v in pairs( frame.args ) do
text = text .. 'key (' .. k .. ') value ('.. v .. ')';
end
return text
end
function ShowArguments.join(frame)
local res='';
local args = frame.args;
local sep = args[1];
res = table.concat( args, sep, 2, j );
return 'sep (' .. sep ..')' .. res
end
return ShowArguments