# 3.4 Aggregate Assignment Statement

The aggregate assignment statement assigns the value of each field of the aggregate on the right of an equal sign to the corresponding field of the aggregate on the left. Both aggregates must be declared with the same structure.

An aggregate assignment statement takes the following form:

    v = e

v
  Is an aggregate reference with the same structure as the aggregate represented by e (see Section 2.2.5).
e
  Is an aggregate reference with the same structure as the aggregate represented by v (see Section 2.2.5).

Example

The following example shows valid aggregate assignments:

    STRUCTURE /DATE/

       INTEGER*1 DAY, MONTH

       INTEGER*2 YEAR

    END STRUCTURE

    RECORD /DATE/ TODAY, THIS_WEEK(7)

    STRUCTURE /APPOINTMENT/

     . . .

       RECORD /DATE/ APP_DATE

    END STRUCTURE

    RECORD /APPOINTMENT/ MEETING

    DO I = 1,7

       CALL GET_DATE (TODAY)

       THIS_WEEK (I)  = TODAY

       THIS_WEEK (I).DAY  = TODAY.DAY + 1

    END DO

    MEETING.APP_DATE = TODAY

Previous Page Next Page Table of Contents