Copy – AMT Datasouth PAL User Manual
Page 73
67
copy
copy
Description
Duplicates multiple stack objects or copies one array, dictionary, or string to anther array, dic-
tionary, or string.
Usage
NAny..1Any NInt
copy
NAny..1Any NAny..1Any
1Array 2Array
copy
2Array
1Dict 2Dict
copy
2Dict
1Str 2Str
copy
2Str
NAny..1Any
Any. Stack objects to duplicate.
NInt
Integer. Number of stack objects to duplicate.
1Array
Array. Source array to copy to 2Array.
2Array
Array. Target array to receive copy of 1Array.
1Dict
Dictionary. Source dictionary to copy to 2Dict.
2Dict
Dictionary. Target dictionary to receive copy of 1Dict.
1Str
String. Source string to copy to 2Str.
2Str
String. Target string to receive copy of 1Str.
Comments
The first variant duplicates the top NInt objects on the operand stack. For composite objects, the
source and duplicate objects will share the same composite data.
The second variant duplicates the composite data within 1Array to 2Array. The objects within
1Array replace the same position objects within 2Array. 2Array must match or exceed the size of
1Array. If 2Array exceeds the size of 1Array, the operation will not affect the additional elements
of 2Array. If 1Array contains composite objects, the duplicate objects placed into 2Array will
share their composite data with the original objects in 1Array.
The third variant duplicates into 2Dict the key + value entries within 1Dict. The key + value pairs
within 1Dict will replace any key + value entries within 2Dict which have identical keys. For
unique key values, the interpreter will add the key + value entries from 1Dict to 2Dict. If 2Dict
contains keys which do not match any keys within 1Dict, the operation will not affect those 2Dict
entry pairs. If 1Dict contains composite objects, the duplicate objects placed into 2Dict will share
their composite data with the original objects in 1Dict.
The fourth variant duplicates the characters in 1Str into 2Str. The characters within 1Str replace
the same position characters within 2Str. 2Str must match or exceed the size of 1Str. If 2Str ex-
ceeds the size of 1Str, the operation will not affect the additional characters of 2Str.