OPERATORS

Increment (++)

Add one to the target.

Syntax

Signature
++target
target++

Description

Add one to the target. The prefix form yields the updated value. The postfix form yields the previous value. Both forms update the target.

Example

Increment.prg
PROCEDURE Main()

   LOCAL nNextTicket := 100
   LOCAL nServed := 0
   LOCAL cName

   FOR EACH cName IN { "Ada", "Jan" }
      QOut( cName, "ticket", nNextTicket++ )
      QOut( "Customers served", ++nServed )
   NEXT
   QOut( "Next available ticket", nNextTicket )

   RETURN

Output