Examples/Module: dplvar (example 2): Difference between revisions

m
Spacing
imported>FrozenPlum
(Created page with "<noinclude>{{noedit}}</noinclude><!-- This is the example preloaded for testing, press "Show Preview" to see the example working (at the bottom of the page). If you save this page, it saves as a new section at the bottom of your '''User:Username/Sandbox''' --> ==Example== This sets <pre> {{#dplvar:set|a|x|b|y|c|<!--empty-->}} {{#dplvar:default|a|aaaa}} {{#dplvar:default|c|cccc}} {{#dplvar:default|d|dddd}} * a: {{#dplvar:a}} * b: {{#dplvar:b}} * c: {{#dplvar:c}} * d: {...")
 
imported>FrozenPlum
m (Spacing)
 
(One intermediate revision by the same user not shown)
Line 5:
-->
==Example==
The first line's statements set the variables initially as: '''{{tt|a}}''' to <code>''x''</code>, '''{{tt|b}}''' to <code>''y''</code>, and '''{{tt|c}}''' to ''<code><nowiki><!--empty--></nowiki></code>''; then the following variables also have a default set: '''{{tt|a}}''' to <code>''aaaa''</code>, '''{{tt|c}}''' to <code>''cccc''</code>, and '''{{tt|d}}''' to <code>''dddd''</code>.
This sets
 
The last four lines display the value of each corresponding variable in a bulleted list format.
 
<pre>
{{#dplvar:set|a|x|b|y|c|<!--empty-->}} {{#dplvar:default|a|aaaa}} {{#dplvar:default|c|cccc}} {{#dplvar:default|d|dddd}}
 
* a: {{#dplvar:a}}
* b: {{#dplvar:b}}
Line 17 ⟶ 19:
==Result==
{{#dplvar:set|a|x|b|y|c|<!--empty-->}} {{#dplvar:default|a|aaaa}} {{#dplvar:default|c|cccc}} {{#dplvar:default|d|dddd}}
 
* a: {{#dplvar:a}}
* b: {{#dplvar:b}}
* c: {{#dplvar:c}}
* d: {{#dplvar:d}}
 
 
'''Notes:'''
* Variable "c" was set to "cccc" because although it was already set, its note is equivalent to an '''empty value'''.
* Variable "d" was set to "dddd" because it was '''not''' already set.
<noinclude>
[[Category:Uses dplvar module]]
Anonymous user