<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3ALoadData</id>
	<title>Module:LoadData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3ALoadData"/>
	<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;action=history"/>
	<updated>2026-04-26T12:04:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=52879&amp;oldid=prev</id>
		<title>Indicwiki: 1 revision imported from :alpha:Module:LoadData</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=52879&amp;oldid=prev"/>
		<updated>2022-12-23T11:43:05Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported from &lt;a href=&quot;https://alpha.indicwiki.in/index.php?title=Module:LoadData&quot; class=&quot;extiw&quot; title=&quot;alpha:Module:LoadData&quot;&gt;alpha:Module:LoadData&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:13, 23 December 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Indicwiki</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=5392&amp;oldid=prev</id>
		<title>Admin: Protected &quot;Module:LoadData&quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading]</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=5392&amp;oldid=prev"/>
		<updated>2022-08-07T11:14:44Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:LoadData&quot; title=&quot;Module:LoadData&quot;&gt;Module:LoadData&lt;/a&gt;&amp;quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading]&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:44, 7 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=5389&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=5389&amp;oldid=prev"/>
		<updated>2022-08-07T11:14:02Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:44, 7 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=52878&amp;oldid=prev</id>
		<title>alpha&gt;Indicwiki: Created page with &quot;local p = {}  -- Finds the next key key &lt;= or &gt;= the given i. -- operator is ±1 local function findItemRange(data, i, operator)     local bestIndex = nil     i = i * operator...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=52878&amp;oldid=prev"/>
		<updated>2022-07-18T10:00:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {}  -- Finds the next key key &amp;lt;= or &amp;gt;= the given i. -- operator is ±1 local function findItemRange(data, i, operator)     local bestIndex = nil     i = i * operator...&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:30, 18 July 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>alpha&gt;Indicwiki</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=5388&amp;oldid=prev</id>
		<title>wikipedia&gt;MusikBot II: Protected &quot;Module:LoadData&quot;: High-risk template or module: 398 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:LoadData&amp;diff=5388&amp;oldid=prev"/>
		<updated>2021-09-30T22:57:10Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:LoadData&quot; title=&quot;Module:LoadData&quot;&gt;Module:LoadData&lt;/a&gt;&amp;quot;: &lt;a href=&quot;https://en.wikipedia.org/wiki/High-risk_templates&quot; class=&quot;extiw&quot; title=&quot;wikipedia:High-risk templates&quot;&gt;High-risk template or module&lt;/a&gt;: 398 transclusions (&lt;a href=&quot;/index.php?title=User:MusikBot_II/TemplateProtector&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:MusikBot II/TemplateProtector (page does not exist)&quot;&gt;more info&lt;/a&gt;) ([Edit=Require autoconfirmed or confirmed access] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Finds the next key key &amp;lt;= or &amp;gt;= the given i.&lt;br /&gt;
-- operator is ±1&lt;br /&gt;
local function findItemRange(data, i, operator)&lt;br /&gt;
    local bestIndex = nil&lt;br /&gt;
    i = i * operator&lt;br /&gt;
    for k, v in pairs(data) do&lt;br /&gt;
    	local kop = type(k) == 'number' and k * operator&lt;br /&gt;
        if kop and kop &amp;lt;= i and (bestIndex == nil or kop &amp;gt; bestIndex * operator) then&lt;br /&gt;
        	bestIndex = k&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if bestIndex then return data[bestIndex] else return nil end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function load(datamodule, frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
    local data = mw.loadData(datamodule)&lt;br /&gt;
    for i = 1, 20 do&lt;br /&gt;
        if args[i] then data = data[tonumber(args[i]) or args[i]]&lt;br /&gt;
        elseif args[i .. ' lteq'] then&lt;br /&gt;
            data = findItemRange(data, tonumber(args[i .. ' lteq']), 1)&lt;br /&gt;
        elseif args[i .. ' gteq'] then&lt;br /&gt;
            data = findItemRange(data, tonumber(args[i .. ' gteq']), -1)&lt;br /&gt;
        else break end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if data == nil then&lt;br /&gt;
    	return args['if_nil'] -- not a required argument, OK to return nil here.&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if type(data) == 'table' then&lt;br /&gt;
    	-- Put the table into another table because the return value of loadData&lt;br /&gt;
    	-- is a &amp;quot;fake&amp;quot; table that only has certain metamethods.&lt;br /&gt;
    	local realdata = {}&lt;br /&gt;
    	for k, v in pairs(data) do&lt;br /&gt;
    		realdata[k] = v&lt;br /&gt;
    	end&lt;br /&gt;
    	data = realdata&lt;br /&gt;
    else&lt;br /&gt;
    	data = { data }&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if args['template'] then&lt;br /&gt;
    	return mw.text.unstripNoWiki(args['template']):format(unpack(data))&lt;br /&gt;
    elseif args['preprocess'] then&lt;br /&gt;
    	return frame:preprocess(mw.text.unstripNoWiki(args['preprocess']):format(unpack(data)))&lt;br /&gt;
    else&lt;br /&gt;
    	return table.concat(data)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return setmetatable({}, {&lt;br /&gt;
	__index = function(t, k)&lt;br /&gt;
		return function(frame)&lt;br /&gt;
			return load('Module:' .. k, frame)&lt;br /&gt;
    	end&lt;br /&gt;
	end&lt;br /&gt;
})&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;MusikBot II</name></author>
	</entry>
</feed>