Array Compare: Difference between revisions
From MultiCharts
no edit summary
(Created page with "Compares a specified range of elements of the specified one-dimensional source array, starting at the specified source index, to the same range of elements of the specified on...") |
No edit summary |
||
Line 6: | Line 6: | ||
Returns a value of 0 if each respective pair of elements compared as equal; a value of 1 if, for the first pair that was not equal, the value in the source range was greater then the value in the destination range; and a value of -1 if, for the first pair that was not equal, the value in the source range was less then the value in the destination range. | Returns a value of 0 if each respective pair of elements compared as equal; a value of 1 if, for the first pair that was not equal, the value in the source range was greater then the value in the destination range; and a value of -1 if, for the first pair that was not equal, the value in the source range was less then the value in the destination range. | ||
== Usage == | |||
<syntaxhighlight>Array_Compare(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements)</syntaxhighlight> | <syntaxhighlight>Array_Compare(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements)</syntaxhighlight> | ||
Where: | 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 compare | |||
== Return == | |||
0 - each respective pair of elements compared as equal | 0 - each respective pair of elements compared as equal | ||
Line 27: | Line 28: | ||
-1 - for the first pair compared that was not equal, the value in the source range was less then the value in the destination range | -1 - for the first pair compared that was not equal, the value in the source range was less then the value in the destination range | ||
== Example == | |||
Assign a value, indicating the result of comparing two-element segments, of Array1, beginning at the index of 4, and of Array2, beginning at the index of 6, to Value1 variable: | Assign a value, indicating the result of comparing two-element segments, of Array1, beginning at the index of 4, and of Array2, beginning at the index of 6, to Value1 variable: | ||