copydata

Syntax

COPYDATA(source_tag, source_occurrence, destination_tag, destination_occurrence)

Arguments

source_tag, destination_tag: database variable (a field tag or FACS field alias)

source_occurrence, destination_occurrence: integer

Meaning

COPYDATA (supported in Collections from version 1.9.5) copies the entire contents (including language attributes) from source_tag[source_occurrence] to destination_tag[destination_occurrence]: it copies all language values from a specified occurrence of a database tag (or FACS tag alias) to another specified occurrence of the same or a different database tag (or FACS tag alias). If the source field is multilingual, the destination field must be multilingual too. For copying unilingual fields you don't need this function: use a simple tag1[occurrence] = tag2[occurrence] assignment instead.

Example 1

copydata(YB, 2, VV, 10)

Result

VV[10] will be overwritten with the entire content of YB[2]. YB[2] will remain unchanged.

Example 2

integer i, j
text tagvar[2], tagvar2[2]

i = 1
j = 5
tagvar = 'do'
tagvar2 = 'do'

copydata(!tagvar, i, !tagvar2, j)

Result

Tag indirection works as well. Tag occurrence do[5] will be overwritten with the entire contents of do[1].