CopyTo method: Row class

Syntax

CopyTo(&row) 

Description

The CopyTo method copies from the row executing the method to the specified target row, copying like-named record fields and subscrolls at corresponding levels. The target Row object must be from a "related" rowset—that is, built from the same records—but it can be under a different parent at higher levels.

This method copies all the records from the Row object executing the method to the target Row object, not just the primary data record associated with the rowset.

In order to copy all of the properties of the fields from the source row, the source and target scrolls must have exactly the same shape:

  • The names of the records in the source and target scrolls must be the same.

  • If there are subscrolls in the source scroll, then the same number of subscrolls must exist in the target scroll.

  • The names of the records in any source subscrolls and target subscrolls must be the same.

Parameters

Parameter Description

row

Specify a target row. This must be a Row object, not a row number.

Returns

None

Example

The following example copies rows from a child rowset (DERIVED_HR) to the current rows.

Local Row &ROW;
Local Rowset &RS1;

&RS1 = GetRowset();
For &I = 1 to &RS1.ActiveRowCount
   &ROW = GetRowset(SCROLL.DERIVED_HR).GetRow(&I);
   &ROW.CopyTo(GetRow(&I));
End-For;