<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.cloudmodding.com/oot/Module:Yesno/doc/history?feed=atom</id>
		<title>Module:Yesno/doc - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.cloudmodding.com/oot/Module:Yesno/doc/history?feed=atom"/>
		<link rel="alternate" type="text/html" href="https://wiki.cloudmodding.com/oot/Module:Yesno/doc/history"/>
		<updated>2026-04-06T18:52:55Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.cloudmodding.com/woot/index.php?title=Module:Yesno/doc&amp;diff=4403&amp;oldid=prev</id>
		<title>Mzxrules: Created page with &quot;== Syntax ==  &lt;source lang=&quot;lua&quot;&gt;yesno(value, default)&lt;/source&gt;  &lt;code&gt;value&lt;/code&gt; is the value to be tested. Boolean input or boolean-style input (see below) always evaluate...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.cloudmodding.com/woot/index.php?title=Module:Yesno/doc&amp;diff=4403&amp;oldid=prev"/>
				<updated>2015-12-06T08:23:08Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Syntax ==  &amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;yesno(value, default)&amp;lt;/source&amp;gt;  &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is the value to be tested. Boolean input or boolean-style input (see below) always evaluate...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&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; is the value to be tested. Boolean input or boolean-style input (see below) always evaluates to either &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; always evaluates to &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;. Other values evaluate to &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;.&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. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some input values always return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, and some always return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; values always return &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;
-- These always return true:&lt;br /&gt;
yesno('yes')&lt;br /&gt;
yesno('y')&lt;br /&gt;
yesno('true')&lt;br /&gt;
yesno('t')&lt;br /&gt;
yesno('1')&lt;br /&gt;
yesno(1)&lt;br /&gt;
yesno(true)&lt;br /&gt;
&lt;br /&gt;
-- These always return false:&lt;br /&gt;
yesno('no')&lt;br /&gt;
yesno('n')&lt;br /&gt;
yesno('false')&lt;br /&gt;
yesno('f')&lt;br /&gt;
yesno('0')&lt;br /&gt;
yesno(0)&lt;br /&gt;
yesno(false)&lt;br /&gt;
&lt;br /&gt;
-- A nil value always returns nil:&lt;br /&gt;
yesno(nil)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String values are converted to lower case before they are matched:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- These always return true:&lt;br /&gt;
yesno('Yes')&lt;br /&gt;
yesno('YES')&lt;br /&gt;
yesno('yEs')&lt;br /&gt;
yesno('Y')&lt;br /&gt;
yesno('tRuE')&lt;br /&gt;
&lt;br /&gt;
-- These always return false:&lt;br /&gt;
yesno('No')&lt;br /&gt;
yesno('NO')&lt;br /&gt;
yesno('nO')&lt;br /&gt;
yesno('N')&lt;br /&gt;
yesno('fALsE')&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can specify a default value if yesno receives input other than that listed above. If you don't supply a default, the module will return &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; for these inputs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- These return nil:&lt;br /&gt;
yesno('foo')&lt;br /&gt;
yesno({})&lt;br /&gt;
yesno(5)&lt;br /&gt;
yesno(function() return 'This is a function.' end)&lt;br /&gt;
&lt;br /&gt;
-- These return true:&lt;br /&gt;
yesno('foo', true)&lt;br /&gt;
yesno({}, true)&lt;br /&gt;
yesno(5, true)&lt;br /&gt;
yesno(function() return 'This is a function.' end, true)&lt;br /&gt;
&lt;br /&gt;
-- These return &amp;quot;bar&amp;quot;:&lt;br /&gt;
yesno('foo', 'bar')&lt;br /&gt;
yesno({}, 'bar')&lt;br /&gt;
yesno(5, 'bar')&lt;br /&gt;
yesno(function() return 'This is a function.' end, 'bar')&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the blank string also functions this way:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno('')        -- Returns nil.&lt;br /&gt;
yesno('', true)  -- Returns true.&lt;br /&gt;
yesno('', 'bar') -- Returns &amp;quot;bar&amp;quot;.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the blank string usually evaluates to false in wikitext, it evaluates to true in Lua. This module prefers the Lua behaviour over the wikitext behaviour. If treating the blank string as false is important for your module, you will need to remove blank arguments at an earlier stage of processing.&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
[[Category:Lua metamodules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mzxrules</name></author>	</entry>

	</feed>