Assignment
- Last UpdatedOct 24, 2022
- 1 minute read
Assignment always makes a copy of the right-hand-side to replace what is on the left-hand side. The following command copies !Y into !X:
!X = !Y
If, for example, !Y is an array, this command will duplicate the entire array making a copy of each of the array elements. The same is true if !Y is an OBJECT.
The technical term for this is deep copy. Following this copy, !X[1] = 'New Value' will change !X[1] but leave the original array !Y unchanged.