Editing Increment 1 You are editing an old version of this page. If you save it, any changes made since this version will be lost. You are editing an old version of this page. If you save it, any changes made since this version will be lost. You are not logged in. The rich text editor does not work with JavaScript switched off. Please either enable it in your browser options, or visit your preferences to switch to the old MediaWiki editor {{experimental|has}} The increment operator is a special case of [[addition]], and adds the fixed value {{Code|literal|1}} to a '''variable'''. This cannot be used on literals or constant variables. This operator is a single instruction by itself and can only be used on one variable at a time. == [[FDS]] == *{{codeblock|{{tag|variable|number}}{{tag|whitespace}}{{Code|operator|got one more}}{{tag|punctuation}}}} **Increases the given variable by 1 and returns the variable's previous value. *{{codeblock|{{Code/experimental|operator|There was one more}}{{tag|whitespace}}{{tag|variable|number}}{{tag|punctuation}}}} **Increases the given variable by 1 and returns the variable's new value. *{{codeblock|{{Code/experimental|operator|add}}{{tag|whitespace}}{{tag|value|number}}{{tag|whitespace}}{{code/experimental|operator|to}}{{tag|whitespace}}{{tag|variable|number}}{{tag|punctuation}}}} **Increases the given variable by the value of the given number. == Example == {{codeblock|{{Code|variable|FiM}}{{Code|whitespace| }}{{Code|operator|got one more}}{{Code|punctuation|.}}{{code|whitespace|<BR />}}{{Code/experimental|operator|There was one more}}{{Code|whitespace| }}{{Code|variable|Pinkie Pie}}{{Code|punctuation|.}}{{code|whitespace|<BR />}}{{code|keyword|I would}}{{code|whitespace| }}{{code/experimental|operator|add}}{{code|whitespace| }}{{code|literal|15}}{{code|whitespace| }}{{code/experimental|operator|to}}{{code|whitespace| }}{{code|variable|Pinkie Pie}}{{code|punctuation|.}}}} This adds {{Code|literal|1}} to the variable {{Code|variable|FiM}} and then to {{code|variable|Pinkie Pie}}, and then adds {{code|literal|15}} to {{code|variable|Pinkie Pie}}. Its Java equivalent is as follows: {{codeblock|<SOURCE LANG=java>FiM++; ++PinkiePie; PinkiePie += 15;</SOURCE>}} == See Also == * [[Add]] * [[Decrement]] * [[Suffix notation]] {{Navbox/Phrases}} Loading editor Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above. Insert: – — … ° ≈ ≠ ≤ ≥ ± − × ÷ ← → · § Sign your username: ~~~~ Wiki markup: {{}} | [] [[]] [[Category:]] #REDIRECT [[]] <s></s> <sup></sup> <sub></sub> <code></code> <blockquote></blockquote> <ref></ref> {{Reflist}} <references/> <includeonly></includeonly> <noinclude></noinclude> {{DEFAULTSORT:}} <nowiki></nowiki> <!-- --> <span class="plainlinks"></span> Symbols: ~ | ¡ ¿ † ‡ ↔ ↑ ↓ • ¶ # ¹ ² ³ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ∞ ‘ “ ’ ” «» ¤ ₳ ฿ ₵ ¢ ₡ ₢ $ ₫ ₯ € ₠ ₣ ƒ ₴ ₭ ₤ ℳ ₥ ₦ № ₧ ₰ £ ៛ ₨ ₪ ৳ ₮ ₩ ¥ ♠ ♣ ♥ ♦ View this template This field is a spam trap. DO NOT fill it in! Edit summary Preview Mobile Desktop Show changes