ChartDirector 7.1 (.NET Edition)

Chart.bSearch2


Usage

[C#]public static double bSearch2(Array a, int startIndex, int len, Object v);
[VB]Public Shared Function bSearch2(a As Array, startIndex As Integer, len As Integer, v As Object) As Double

Description

Uses binary search to search for a value in an array segment.

This method is the same as Chart.bSearch except it only searches an array segment beginning from the given index and of the given length.

Arguments

ArgumentDefaultDescription
a(Mandatory)The array to be searched.
startIndex(Mandatory)The array index to begin the search
len(Mandatory)The number of elements to search.
v(Mandatory)The value to search for.

Return Value

The index of the value within the array segment. If the value is in between two elements of the array segment, this method returns a non-integer that interpolates the indexes of the two elements. If the value is smaller or larger than all the elements in the array segment, thie method returns the nearest index within the array segment.