Auto-Increment and Auto-Decrement Operators

Auto-increment and auto-decrement Operators increase or decrease the value they are applied to by 1.

Symbol Type Name Description Example
Number
++ Prefix Pre-increment Increments the term by 1, then returns the new value ++a
++ Postfix Post-increment Returns the term value, then increments the term by 1 a++
-- Prefix Pre-decrement Decrements the term by 1, then returns the new value --a
-- Postfix Post-decrement Returns the term value, then decrements the term by 1 a--

The Operators will convert any non-Number to a Number first.

Auto-increment and auto-decrement Operators are designed for use on Variables. Using them on literal terms will work, but post-increment and post-decrement will have essentially no effect.

ptpscript/operators/auto-increment.txt · Last modified: 2007/01/24 10:15
 
 
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki