Wikia

FiM++ Community Wiki

Changes: Increment

Edit

Back to page

(added experimental warning)
(oops there's still some decrement grammar here.)
Line 1: Line 1:
 
{{experimental|has}}
 
{{experimental|has}}
   
The increment operator is a special case of [[addition]], and adds the fixed value {{Code|literal|1}} from 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.
+
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]] ==
 
== [[FDS]] ==
 
*{{codeblock|{{tag|variable|number}}{{tag|whitespace}}{{Code|operator|got one more}}{{tag|punctuation}}}}
 
*{{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.
+
**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}}}}
 
*{{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.
+
**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}}}}
 
*{{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.
+
**Increases the given variable by the value of the given number.
   
 
== Example ==
 
== Example ==

Revision as of 15:33, October 29, 2014

Icon Warning  EXPERIMENTAL  Icon Warning
This article or section contains experimental features. Use caution when implementing them, as they may be removed or changed at any time.

The increment operator is a special case of addition, and adds the fixed value 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

Example

FiM got one more.
Icon Warning There was one more Pinkie Pie.
I would Icon Warning add 15 Icon Warning to Pinkie Pie.

This adds 1 to the variable FiM and then to Pinkie Pie, and then adds 15 to Pinkie Pie.

Its Java equivalent is as follows:

FiM++;
++PinkiePie;
PinkiePie += 15;

See Also


Around Wikia's network

Random Wiki