cArray: CopyEx

CopyEx

Copies a section of one Array to another Array and performs type casting as necessary.



 Public Sub CopyEx(
	  ByRef SourceArray As Variant,
	  ByVal SourceIndex As Long,
	  ByRef DestinationArray As Variant,
	  ByVal DestinationIndex As Long,
	  ByVal Count As Long,
	  Optional ByVal AddressOfCopier As Long = 0 )

Parameters

SourceArray
[ByRef] Variant. The array from which to copy the elements.
SourceIndex
[ByVal] Long. The starting element in the source array to begin copying from.
DestinationArray
[ByRef] Variant. The array in which to place the elements.
DestinationIndex
[ByVal] Long. The starting element in the destination array to place elements.
Count
[ByVal] Long. The number of elements to copy.
AddressOfCopier
[ByVal] Optional. Long. A callback address to a method used to assign elements from the source array to the destination array.  

Default: 0

Remarks

The AddressOfCopier method signature must be two parameters of ByRef for the datatypes of each of the arrays. The destination array element is the first parameter.

Example

This is an example of a callback method declaration.
 Public Sub CopyCallback(ByRef dst As String, ByRef src As MyClass)
     dst = src.Name
 End Sub
 

See Also

Project VBCorLib Overview Class cArray Overview cArray Properties cArray Methods Copy CreateInstance