Difference between revisions of "Template:If"

From SimsWiki
Jump to: navigation, search
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 
{{{else{{{test|}}}|{{{test{{{test|}}}|{{{then|}}}}}}}}}<noinclude>== Usage ==
 
{{{else{{{test|}}}|{{{test{{{test|}}}|{{{then|}}}}}}}}}<noinclude>== Usage ==
<pre>
+
 
{{if
+
<pre>{{if
 
   |test=VARIABLE_OR_PARAMETER_TO_TEST
 
   |test=VARIABLE_OR_PARAMETER_TO_TEST
 
   |then=code if 'test' is not empty
 
   |then=code if 'test' is not empty
 
   |else=code if 'test' is empty
 
   |else=code if 'test' is empty
}}
+
}}</pre>
</pre>
+
 
  
 
Parameter '''else''' is optional. So you may also do:
 
Parameter '''else''' is optional. So you may also do:
  
<pre>
+
<pre>{{if
{{if
+
 
   |test=VARIABLE_OR_PARAMETER_TO_TEST
 
   |test=VARIABLE_OR_PARAMETER_TO_TEST
 
   |then=code if 'test' is not empty
 
   |then=code if 'test' is not empty
}}
+
}}</pre>[[Category: Templates]]</noinclude>
</pre></noinclude>
+

Latest revision as of 07:21, 29 October 2012

Usage

{{if
  |test=VARIABLE_OR_PARAMETER_TO_TEST
  |then=code if 'test' is not empty
  |else=code if 'test' is empty
}}


Parameter else is optional. So you may also do:

{{if
  |test=VARIABLE_OR_PARAMETER_TO_TEST
  |then=code if 'test' is not empty
}}
Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox