Jump to navigation
Jump to search
Notmyhandle (talk | contribs) (→{{#switch:}}: fixed footer nav) |
Notmyhandle (talk | contribs) (brief #var and #vardefine section start) |
||
Line 346: | Line 346: | ||
|When used in a template, depending on what you pass to "{{{parametername}}}", it could be either "Whatever", "Something", or "Nothing" if nothing is passed. | |When used in a template, depending on what you pass to "{{{parametername}}}", it could be either "Whatever", "Something", or "Nothing" if nothing is passed. | ||
|} | |} | ||
=== <nowiki>{{#vardefine:}}</nowiki> and <nowiki>{{#var:}}</nowiki> === | |||
*'''Example template''': {{t|im/loz}} | |||
Vardefine is used to declare and set a variable. #var is used to call the value of that variable. Thus, you can separate your code, such as with a #switch, and later use the value of that switch. The only reason to use a #vardefine and var# is if you are going to use the value of a given variable more than once. Otherwise the value of #var can be replaced with the original #switch. | |||
;This will print "Value" | |||
<pre> | |||
{{#vardefine:VariableName|Value}} | |||
{{#var:VariableName}} | |||
</pre> | |||
{{Footer Nav|game=StrategyWiki:Guide|prevpage=Regular expressions|nextpage=Walkthrough}} | {{Footer Nav|game=StrategyWiki:Guide|prevpage=Regular expressions|nextpage=Walkthrough}} |