<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.digitalcellulose.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AIteration%2Fdoc</id>
	<title>Module:Iteration/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.digitalcellulose.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AIteration%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.digitalcellulose.com/wiki/index.php?title=Module:Iteration/doc&amp;action=history"/>
	<updated>2026-05-23T23:22:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://www.digitalcellulose.com/wiki/index.php?title=Module:Iteration/doc&amp;diff=152515&amp;oldid=prev</id>
		<title>Adminsuzy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.digitalcellulose.com/wiki/index.php?title=Module:Iteration/doc&amp;diff=152515&amp;oldid=prev"/>
		<updated>2020-09-13T20:46:57Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:46, 13 September 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&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>Adminsuzy</name></author>
		
	</entry>
	<entry>
		<id>https://www.digitalcellulose.com/wiki/index.php?title=Module:Iteration/doc&amp;diff=152514&amp;oldid=prev</id>
		<title>Imported&gt;Sarang: +link</title>
		<link rel="alternate" type="text/html" href="https://www.digitalcellulose.com/wiki/index.php?title=Module:Iteration/doc&amp;diff=152514&amp;oldid=prev"/>
		<updated>2020-07-28T16:56:52Z</updated>

		<summary type="html">&lt;p&gt;+link&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{Module rating|release}}[[Category:Modules for general use]]&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
This module contains the functions for different templates, solving their '''iteration problem'''&lt;br /&gt;
:The Wikipedia template coding does not support the repetitive processing of a parameter set, &lt;br /&gt;
:which leads often to a very primitive and long chain of parameter checks in the kind of {{#tag:syntaxhighlight|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{{#if:{{{1|}}} | perform an action with parameter 1 }}&lt;br /&gt;
{{#if:{{{2|}}} | perform an action with parameter 2 }}&lt;br /&gt;
{{#if:{{{3|}}} | perform an action with parameter 3 }}&lt;br /&gt;
{{#if:{{{4|}}} | perform an action with parameter 4 }}&lt;br /&gt;
•••&lt;br /&gt;
•••&lt;br /&gt;
{{#if:{{{33|}}} perform an action with parameter 33 }}&amp;lt;/nowiki&amp;gt;|lang=&amp;quot;text&amp;quot;}}&lt;br /&gt;
with the disadvantage that such a construct will fail as soon as there comes a 34{{exp|nd}} parm.&lt;br /&gt;
&lt;br /&gt;
I always thought that with Lua and its &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loops this  iterations should be possible, somehow.&amp;lt;br&amp;gt;&lt;br /&gt;
After long searching without any success and without an idea how to perform it, I asked at several forums&amp;lt;br&amp;gt; &lt;br /&gt;
and got finally from {{Ut|Trappist the monk|+|en}} the helping hint to solve it with a control structure like{{#tag:syntaxhighlight|&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for i, v in ipairs (args) do&lt;br /&gt;
		table.insert (out, frame:expandTemplate{ title = title, args = v })&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat (out)|lang=&amp;quot;text&amp;quot;}}&lt;br /&gt;
The functions contained therein are from very simple, just one parameter to pass, &amp;lt;br&amp;gt;&lt;br /&gt;
to more complicated ones, where e.g. a pair of parameters needs kind of a flip-flop switch&amp;lt;br&amp;gt;&lt;br /&gt;
when always a tuple of e.g. an item and its correlated text needs to be passed. &amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When there are tuples, triples etc., the &amp;lt;tt&amp;gt;table.insert&amp;lt;/tt&amp;gt; occurs, when the last element is processed;&amp;lt;br&amp;gt;&lt;br /&gt;
this performs problems when the last group is incomplete – it should be finished with empty values &amp;lt;br&amp;gt;&lt;br /&gt;
to trigger the &amp;lt;tt&amp;gt;table.insert&amp;lt;/tt&amp;gt;. The check with &amp;lt;tt&amp;gt;table.maxn&amp;lt;/tt&amp;gt; seems not to work correctly ?&amp;lt;br&amp;gt;&lt;br /&gt;
''This'' problem is solved differently, for the function &amp;quot;attribs&amp;quot; with a primitive workaround.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== File list templates ===&lt;br /&gt;
The three &amp;quot;Ifim &amp;quot; templates avoid to display the file itself as an 'other version'. &amp;lt;br&amp;gt;&lt;br /&gt;
There are currently five templates creating file lists with the &amp;lt;tt&amp;gt;function:filelist&amp;lt;/tt&amp;gt;&lt;br /&gt;
# {{T0|Other versions}} a vertical list (without initial)&lt;br /&gt;
# {{T0|Filelist}} a horizontal list (without initial)&lt;br /&gt;
# {{T0|Derivative versions}} a vertical list &lt;br /&gt;
# {{T0|Derived from}} a vertical list&lt;br /&gt;
# {{T0|File}} a horizontal list&lt;br /&gt;
All these templates support also the &amp;quot;gallery&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
=== Other file lists ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;function:svglang&amp;lt;/tt&amp;gt; creates a list of just file_names and language_codes, for &lt;br /&gt;
#&amp;lt;li value=&amp;quot;6&amp;quot;&amp;gt; {{T0|Svg lang}}&lt;br /&gt;
# {{T0|Lang gallery}}&lt;br /&gt;
Much more is created by the &amp;lt;tt&amp;gt;function:ownbased&amp;lt;/tt&amp;gt; for the template&lt;br /&gt;
#&amp;lt;li value=&amp;quot;8&amp;quot;&amp;gt;{{T0|Own based}}&amp;lt;br&amp;gt;&lt;br /&gt;
which will handle in the ''majority of cases'' just one file, but can serve an unlimited number.&amp;lt;br&amp;gt;&lt;br /&gt;
This list can be controlled by the user to be displayed &amp;lt;tt&amp;gt;either&amp;lt;/tt&amp;gt; horizontally or vertically.&amp;lt;br&amp;gt;&lt;br /&gt;
#&amp;lt;li value=&amp;quot;9&amp;quot;&amp;gt;{{T0|Attribs}}&amp;lt;br&amp;gt;&lt;br /&gt;
The template works, whether there is a user assigned for a file, or one filename follows another.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Imported&gt;Sarang</name></author>
		
	</entry>
</feed>