AClone Function (Array) | |
Duplicate a multidimensional array.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION AClone(
aSource AS ARRAY
) AS ARRAY
public static Array AClone(
Array aSource
)
Request Example
View SourceParameters
- aSource
- Type: Array
The array to duplicate.
Return Value
Type:
Array
A duplicate of
aSource.
Remarks
AClone() creates a complete duplicate of aSource.
If aSource contains subarrays, AClone() creates matching subarrays and fills them with copies of the values in the aSource subarrays.
To copy subarrays by reference instead of creating new ones, use ACloneShallow().
Examples
This example creates an array, then duplicates it using AClone().
The first array is then altered, but the duplicate copy is unaffected:
1LOCAL aOne, aTwo AS ARRAY
2aOne := {1, 2, 3}
3aTwo := AClone(aOne)
4aOne[1] := 99
5
See Also