+1 888 340 6572

Array Copy: Difference between revisions

From MultiCharts
(Created page with "Copies a specified number of elements from the specified one-dimensional source array, starting at the specified source index; the elements are copied to the specified one-dim...")
 
No edit summary
 
Line 2: Line 2:
Source and destination can be the same array as well as two different arrays.  
Source and destination can be the same array as well as two different arrays.  
   
   
==== Usage ====
== Usage ==
<syntaxhighlight>Array_Copy(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements)</syntaxhighlight>  
<syntaxhighlight>Array_Copy(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements)</syntaxhighlight>  


Where: [[SourceArray]] - an expression specifying the name of the source array  
Where:  
:'''SourceArray''' - an expression specifying the name of the source array  
              
              
[[DestinationArray]] - an expression specifying the name of the destination array  
:'''DestinationArray''' - an expression specifying the name of the destination array  
              
              
[[SourceIndex]] - a numerical expression specifying the starting index for the source array  
:'''SourceIndex''' - a numerical expression specifying the starting index for the source array  
              
              
[[DestinationIndex]] - a numerical expression specifying the starting index for the destination array  
:'''DestinationIndex''' - a numerical expression specifying the starting index for the destination array  
              
              
[[NumberOfElements]] - a numerical expression specifying the number of elements to copy  
:'''NumberOfElements''' - a numerical expression specifying the number of elements to copy  
   
   
==== Example ====
== Example ==
Copy from Array1 the two-element segment beginning at the index of 4, to the Array2, beginning at the index of 6:  
Copy from Array1 the two-element segment beginning at the index of 4, to the Array2, beginning at the index of 6:  



Latest revision as of 21:24, 27 February 2017

Copies a specified number of elements from the specified one-dimensional source array, starting at the specified source index; the elements are copied to the specified one-dimensional destination array, starting at the specified destination index. Source and destination can be the same array as well as two different arrays.

Usage

Array_Copy(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements)

Where:

SourceArray - an expression specifying the name of the source array
DestinationArray - an expression specifying the name of the destination array
SourceIndex - a numerical expression specifying the starting index for the source array
DestinationIndex - a numerical expression specifying the starting index for the destination array
NumberOfElements - a numerical expression specifying the number of elements to copy

Example

Copy from Array1 the two-element segment beginning at the index of 4, to the Array2, beginning at the index of 6:

Array_Copy(Array1,4,Array2,6,2);

Copy from Array1 the two-element segment beginning at the index of 4, to the same array, beginning at the index of 6:

Array_Copy(Array1,4,Array1,6,2);