<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3APn</id>
	<title>Module:Pn - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3APn"/>
	<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Pn&amp;action=history"/>
	<updated>2026-04-10T12:28:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:Pn&amp;diff=15205&amp;oldid=prev</id>
		<title>Caleb Cooper: Created page with &quot;--[[ Module that returns one value from a list of unnamed parameters Named parameter idx is the index of the parameter that is to be returned Negative indices count backward f...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Pn&amp;diff=15205&amp;oldid=prev"/>
		<updated>2020-11-02T16:48:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[ Module that returns one value from a list of unnamed parameters Named parameter idx is the index of the parameter that is to be returned Negative indices count backward f...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
Module that returns one value from a list of unnamed parameters&lt;br /&gt;
Named parameter idx is the index of the parameter that is to be returned&lt;br /&gt;
Negative indices count backward from the end of the list&lt;br /&gt;
==]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
p.getVal = function(frame)&lt;br /&gt;
	local args = {}&lt;br /&gt;
	-- copy arguments from frame object and its parent&lt;br /&gt;
	for k, v in pairs(frame.args) do&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	for k, v in pairs(frame:getParent().args) do&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	if not args[1] then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local idx = tonumber(args.idx) or 1&lt;br /&gt;
	if idx &amp;lt; 0 then idx = #args + idx + 1 end&lt;br /&gt;
	return args[idx]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
</feed>