Actions

Template

Difference between revisions of "Addvar"

From Retro CDN

(Created page with "<includeonly>{{#ifeq:{{#var:{{{1}}}}}||{{#vardefine:{{{1}}}|{{{2}}}}}|{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{#if:{{{2|}}}|{{{2}}}|0}}}}}}}}</includeonly><noinclude> A...")
 
m
 
Line 13: Line 13:
 
{{#vardefine:testvalue|5}}{{addvar|testvalue|3}}
 
{{#vardefine:testvalue|5}}{{addvar|testvalue|3}}
 
testvalue = {{#var:testvalue}}
 
testvalue = {{#var:testvalue}}
[[Category:Retro CDN templates]]
+
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 08:22, 5 November 2021

Add a value to a variable.

Usage

{{#vardefine:testvalue|5}}
{{addvar|testvalue|3}}
testvalue = {{#var:testvalue}}

Returns:


testvalue = 8