Difference between revisions of "Template:Add"

From QBWiki
Jump to navigation Jump to search
(Created page with "{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}<noinclude>Shorthand for adding variable to something: "<nowiki>{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0...")
 
m
 
Line 1: Line 1:
 
{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}<noinclude>Shorthand for adding variable to something: "<nowiki>{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}</nowiki>"
 
{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}<noinclude>Shorthand for adding variable to something: "<nowiki>{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}</nowiki>"
  
Example:
+
Examples:
 
{{Save|x}}
 
{{Save|x}}
 
{| class=wikitable
 
{| class=wikitable

Latest revision as of 14:07, 26 August 2022

Shorthand for adding variable to something: "{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}"

Examples:

Input Output
{{#vardefine:x|100}}x = 100
{{Add|x|20}}x + 20 = {{#var:x}}

{{#vardefine:y|200}}y = 200

{{Add|x|{{#var:y}}}}x + y = {{#var:x}}
x = 100

x + 20 = 120

y = 200

x + y = 320