<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.akamaru.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AYesno%2FDoku</id>
	<title>Modul:Yesno/Doku - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.akamaru.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AYesno%2FDoku"/>
	<link rel="alternate" type="text/html" href="https://wiki.akamaru.de/index.php?title=Modul:Yesno/Doku&amp;action=history"/>
	<updated>2026-10-16T16:14:17Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Aka&#039;s Wiki</subtitle>
	<generator>MediaWiki 1.43.10</generator>
	<entry>
		<id>https://wiki.akamaru.de/index.php?title=Modul:Yesno/Doku&amp;diff=1230&amp;oldid=prev</id>
		<title>Akamaru: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://wiki.akamaru.de/index.php?title=Modul:Yesno/Doku&amp;diff=1230&amp;oldid=prev"/>
		<updated>2018-08-17T12:44:38Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DU}}&lt;br /&gt;
Das Modul bietet eine Schnittstelle zum Umgang mit boolschen Werten. Lua bietet die boolschen Werte &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; und &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, der Wikicoade liefert allerdings nur Zeichenketten. Dieses Modul wandelt die übergebenen Zeichenketten in boolsche Werte um und berücksichtigt dabei auch verschiedene Schreibweisen.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;yesno(value, default)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; wird dabei getestet und nach &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;. Letzteres wird zurückgegeben, wenn nichts übergeben wird. Alles andere bekommt den bei &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; angegebenen Wert.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
First, load the module. Note that it can only be loaded from other Lua modules, not from normal wiki pages. For normal wiki pages you can use {{tl|yesno}} instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Das liefert immer true:&lt;br /&gt;
yesno(&amp;#039;yes&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;y&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;j&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;ja&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;true&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;1&amp;#039;)&lt;br /&gt;
yesno(1)&lt;br /&gt;
yesno(true)&lt;br /&gt;
&lt;br /&gt;
-- Das liefert immer false:&lt;br /&gt;
yesno(&amp;#039;no&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;nein&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;n&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;false&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;0&amp;#039;)&lt;br /&gt;
yesno(0)&lt;br /&gt;
yesno(false)&lt;br /&gt;
&lt;br /&gt;
-- nil ergibt immer nil:&lt;br /&gt;
yesno(nil)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zeichenketten werden immer erst in Kleinbuchstaben umgewandelt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Dieses ergibt auch immer true:&lt;br /&gt;
yesno(&amp;#039;Yes&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;YES&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;yEs&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;Y&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;tRuE&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- UNd dieses auch immer false:&lt;br /&gt;
yesno(&amp;#039;No&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;NO&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;nO&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;N&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;fALsE&amp;#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Du kannst einen Standardrückgabewert für unbekannte Werte angeben. Gibst du nichts an, ist der Wert immer &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Das ergibt nil:&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;)&lt;br /&gt;
yesno({})&lt;br /&gt;
yesno(5)&lt;br /&gt;
yesno(function() return &amp;#039;This is a function.&amp;#039; end)&lt;br /&gt;
&lt;br /&gt;
-- Das ergibt true:&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;, true)&lt;br /&gt;
yesno({}, true)&lt;br /&gt;
yesno(5, true)&lt;br /&gt;
yesno(function() return &amp;#039;This is a function.&amp;#039; end, true)&lt;br /&gt;
&lt;br /&gt;
-- Das ergibt nil &amp;quot;bar&amp;quot;:&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno({}, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno(5, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno(function() return &amp;#039;This is a function.&amp;#039; end, &amp;#039;bar&amp;#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Leere Zeichenketten funktionieren wie normale Zeichenketten:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(&amp;#039;&amp;#039;)        -- Returns nil.&lt;br /&gt;
yesno(&amp;#039;&amp;#039;, true)  -- Returns true.&lt;br /&gt;
yesno(&amp;#039;&amp;#039;, &amp;#039;bar&amp;#039;) -- Returns &amp;quot;bar&amp;quot;.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
[[Kategorie:Module]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akamaru</name></author>
	</entry>
</feed>