next up previous contents index
Next: The Case statement Up: Statements controlling program flow. Previous: Statements controlling program flow.

Assignments

In addition to the standard Pascal assignment operator (:=), Free Pascal supports some c-style constructions. All available constructs are listed in table (1.5).

  

Assignment Result
a += b Adds b to a, and stores the result in a.
a -= b Substracts b from a, and stores the result in a.
a *= b Multiplies a with b, and stores the result in a.
a /= b Divides a through b, and stores the result in a.
Table 1.5: Allowed C constructs in Free Pascal

For these connstructs to work, you should specify the -Sc command-line switch.

Remark: These constructions are just for typing convenience, they don't generate different code.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998