Dplvar: Difference between revisions

m
Formatting fixes/changes
imported>FrozenPlum
imported>FrozenPlum
m (Formatting fixes/changes)
 
Line 2:
 
==Syntax==
* '''Sets one''' symbolic variable name and assign a value:
<pre>{{#dplvar:set|varname|valueofvar}}</pre>
<pre>
{{#dplvar:set|varname|valueofvar}}
</pre>
 
* '''Sets multiple''' symbolic variable names '''and assigns''' values to them (one after the other):
<pre>
{{#dplvar:set|name1|value1|name2|value2|..|..}}
</pre>
 
* '''Assigns''' a value '''only if the variable is empty / has not been used''' so far:
<pre>
{{#dplvar:default|name|value}}
</pre>
 
* '''Returns''' the current value of the variable:
<pre>
{{#dplvar:name}}
</pre>
{{note|The'''Note:''' variablesVariables can be set and retrieved from an article page, or from templates used in that article.}}
 
 
==Example 1==
Line 34 ⟶ 33:
'''Part 2 Result:'''
{{#lsth:Examples/Module: dplvar (example 1)|Part 2 Result}}
 
 
==Example 2==
'''Example:'''
{{#lsth:Examples/Module: dplvar (example_2)|Example}}
{{ViewTest|Examples|Module: dplvar (example 2)}}
'''Part 1 Result:'''<!--
-->{{#lsth:Examples/Module: dplvar (example 2)|Result}}
 
Anonymous user