Assignment statement

Description

Assignments statements are made up of a left-hand side and a right-hand side, seperated by the assignment operator (:=). The left-hand side of an assignment statement is either a variable, function identifier, or a property of an instance variable (see object variables for information about instance variables). The right-hand side of an assignment statement is an expression.

When a assignment statement is executed, its right-hand side is evaluated and its value is stored in the left-hand side. The value of the right-hand side must be assignment compatible with the type of the left-hand side.

NOTE: Functions return values by assigning values to their function identifiers.

Example

   x := 1+1

is a simple example. When this statement is executed the right-hand side

   1+1

is evaluated, and the resulting value (i.e. 2) is stored in the left-hand side (i.e. the variable x).

Syntax

(NOTE: for clarity some parts of the syntax are omitted, see Irie Pascal Grammar for the full syntax):

   assignment-statement = assignment-statement-lhs ':=' expression

   assignment-statement-lhs = variable-access | function-identifier | property-designator

   property-designator = object-variable '.' property-specifier