Assignments

This section provides the syntax, description, and an example of JADE assignments, as well as:

Syntax

left-hand-side := expression;

Description

The colon and equals symbols (:=) used in conjunction are known as the assignment operator. The assignment operator is usually read as becomes.

The types of left‑hand‑side and expression values in the assignment operator must be compatible. The left‑hand‑side can be one of the following.

When an assignment instruction is executed, the expression on the right of the assignment operator is evaluated and assigned to the entity on the left of the assignment operator. If the left‑hand‑side is a compound expression (for example, customer.name), this is evaluated before the assignment.

Example

The following example shows the use of assignments.

vars
    anInt : Integer;
    aBool : Boolean;
    aStr  : String;
    aReal : Real;
begin
    anInt := 2;
    aBool := true;
    aStr  := " a string";
    aReal := 2.0;
end;