copy

copy(toColl: Collection input);

The copy method of the Set class copies entries from the receiver collection to a compatible collection passed as the toColl parameter. In this case, compatible means that the memberships of the receiver and destination collections are type-compatible.

Entries copied from the receiver collection are added to entries that already exist in the collection to which you copy them.

The following example of the copy method returns all regions for the company.

getAllRegions(regionSet: RegionSet input);
vars
   country : Country;
begin
   // For each country in the company, copy the country's regions into the set
   foreach country in allCountries do
       country.allRegions.copy(regionSet);
   endforeach;
end;

The following example of the copy method returns a snapshot of all sales for the company.

getAllSales(saleSet: SaleSet input);
begin
   // If the company has some sales, copy them into the supplied set
   if not allSalesByItem.isEmpty then allSalesByItem.copy(saleSet); endif;
end;