Increment

x++

increases the value of x by 1, returning the old value of x.

Details

Examples

open allclose all

Basic Examples  (1)

Increment the value by one, and return the old value:

Scope  (4)

Increment a numerical value:

Increment a symbolic value:

Increment all values in a list:

The argument to Increment need not be a symbol:

Applications  (1)

Find the first integer with a certain property:

Properties & Relations  (4)

Increment and PreIncrement differ only in the return value of the operation:

Increment is a short form of this assignment:

Increment is a special case of AddTo:

Decrement and PreDecrement are closely related operations:

Possible Issues  (1)

A variable to be incremented must have an initial value:

Wolfram Research (1988), Increment, Wolfram Language function, https://reference.wolfram.com/language/ref/Increment.html.

Text

Wolfram Research (1988), Increment, Wolfram Language function, https://reference.wolfram.com/language/ref/Increment.html.

CMS

Wolfram Language. 1988. "Increment." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Increment.html.

APA

Wolfram Language. (1988). Increment. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Increment.html

BibTeX

@misc{reference.wolfram_2024_increment, author="Wolfram Research", title="{Increment}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Increment.html}", note=[Accessed: 30-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_increment, organization={Wolfram Research}, title={Increment}, year={1988}, url={https://reference.wolfram.com/language/ref/Increment.html}, note=[Accessed: 30-December-2024 ]}