ACloneT Function (Array OfT) | |
Duplicate a multidimensional array.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION AClone<T>(
aSource AS ARRAY OF<T>
)
AS ARRAY OF<T>
public static Array Of<T> AClone<T>(
Array Of<T> aSource
)
Request Example
View SourceParameters
- aSource
- Type: Array OfT
The array to duplicate.
Type Parameters
- T
- The type of the array elements
Return Value
Type:
Array OfT
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