PreIncrement

++x

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

Details

Examples

open allclose all

Basic Examples  (1)

Increment the value by 1 and return the new value:

Scope  (4)

Increment a numerical value:

Increment a symbolic value:

Increment all values in a list:

The argument to PreIncrement need not be a symbol:

Applications  (1)

Find the first integer with a certain property:

Properties & Relations  (4)

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

PreIncrement is a short form of this assignment:

PreIncrement 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), PreIncrement, Wolfram Language function, https://reference.wolfram.com/language/ref/PreIncrement.html.

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_preincrement, organization={Wolfram Research}, title={PreIncrement}, year={1988}, url={https://reference.wolfram.com/language/ref/PreIncrement.html}, note=[Accessed: 14-November-2024 ]}