Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 347: | Line 347: | ||
|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}} |