TAL Programmer's Guide
Accessing Structure Items
Using Structures
096254 Tandem Computers Incorporated 8–41
Copying Structure Items
You can use a move statement to copy structure items within and between structures
and substructures. Structure items you can copy are simple variables, arrays, and
pointers declared within structures or substructures.
For example, to copy an array from one structure to another structure, specify in a
move statement:
The fully qualified identifiers of the destination and source arrays
The FOR clause with or without the BYTES or WORDS qualifier
The FOR clause copies the specified number of bytes, words, doublewords, or
quadruplewords depending on the data type of the source array. To copy bytes or
words regardless of source data type, include the BYTES or WORDS qualifier in the
FOR clause.
The following example shows how you can copy an array from one structure to
another, first in quadrupleword units, then in word units:
STRUCT .s_struct;
BEGIN
FIXED array[0:2]; !Source ARRAY is in S_STRUCT
END;
STRUCT .d_struct (s_struct);
!Destination ARRAY is in D_STRUCT
PROC m;
BEGIN
d_struct.array ':=' s_struct.array FOR 3;
!Copy three quadruplewords as
! dictated by FIXED data type
d_struct.array ':=' s_struct.array FOR 6 WORDS;
!Copy six words as dictated by
END; ! the WORDS qualifier