TradeMUX SDK Documentation  1.0
TradeMUX SDK Documentation
int ArrayBsearch< T > ( TMXArray< T >  array,
value,
int  count = WHOLE_ARRAY,
int  start = 0,
int  direction = MODE_ASCEND 
)

Searches for a specified value in a one-dimension array

Template Parameters
TArray content type
Parameters
arrayArray for search
valueValue for search
countCount of elements to search for. By default, it searches in the whole array
startStarting index to search for. By default, the search starts at the first element
directionSearch direction. It can be any of the following values:
MODE_ASCEND searching in forward direction,
MODE_DESCEND searching in backward direction
Returns
The function returns index of a found element. If the wanted value isn't found, the function returns the index of an element nearest in value

Binary search processes only sorted arrays. To sort numeric arrays use the ArraySort() function