Template:CheckTrueFalse: Difference between revisions

From Shadow Chronicles - Game Master
Jump to navigation Jump to search
No edit summary
No edit summary
 
(45 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{{1|}}}|{{#if:{{{2|}}}|{{{2|}}}|{{#ifeq:{{{2|}}}|false|false|{{#ifeq:{{{2|}}}|true|<strong class="error">Error! "{{{2|}}}" is not true or false</strong>}}}}}}|{{#if:{{{2|}}}|{{{2|}}}|{{#ifeq:{{{2|}}}|false|false|{{#ifeq:{{{2|}}}|true|<strong class="error">Error! "{{{2|}}}" is not true or false</strong>}}}}}}|{{#if:{{{2|}}}|{{{2|}}}|{{#ifeq:{{{2|}}}|false|false|{{#ifeq:{{{2|}}}|true|<strong class="error">Error! "{{{2|}}}" is not true or false</strong>}}}}}}}}</includeonly><noinclude>
<includeonly>{{#if:{{{1|}}}|<!--
 
-->{{#ifeq:{{{1|}}}|true|true|<!--
  -->{{#ifeq:{{{1|}}}|false|false|<strong class="error">Error! Condition only support boolean value of true or false.</strong>}}<!--
-->}}
|<!--
-->{{#if:{{{2|}}}|<!--
  -->{{#if:{{{1|}}}|<!--
    -->{{#ifeq:{{{1|}}}|true|true|<!--
      -->{{#ifeq:{{{1|}}}|false|false|<strong class="error">Error! Default boolean only support boolean value of true or false.</strong>}}<!--
    -->}}<!--
  -->|}}<!--
-->|false}}<!--
-->}}</includeonly><noinclude>This support a true or false value with default false (can be changed).
==Example use==
==Example use==
  <nowiki>{{checkTrueFalse|true}}
  <nowiki>{{checkTrueFalse|true}}</nowiki>      // {{checkTrueFalse|true}}
 
<nowiki>{{checkTrueFalse|false}}</nowiki>      // {{checkTrueFalse|false}}
{{checkTrueFalse|false}}
<nowiki>{{checkTrueFalse||true}}</nowiki>      // {{checkTrueFalse||true}}
 
<nowiki>{{checkTrueFalse|}}</nowiki>          // {{checkTrueFalse|}}
{{checkTrueFalse||true}}
<nowiki>{{checkTrueFalse|false|true}}</nowiki> // {{checkTrueFalse|false|true}}
<nowiki>{{checkTrueFalse|nottrue|}}</nowiki>  // {{checkTrueFalse|nottrue|}}
<nowiki>{{checkTrueFalse||nottrue}}</nowiki>  // {{checkTrueFalse||nottrue}}


[[Category:Templates]]
[[Category:Templates]]

Latest revision as of 12:06, 17 April 2021

This support a true or false value with default false (can be changed).

Example use

{{checkTrueFalse|true}}       // true
{{checkTrueFalse|false}}      // false
{{checkTrueFalse||true}}      // 
{{checkTrueFalse|}}           // false
{{checkTrueFalse|false|true}} // false
{{checkTrueFalse|nottrue|}}   // Error! Condition only support boolean value of true or false.
{{checkTrueFalse||nottrue}}   //