The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



FindInArray


Unit:SDL_openarrays
Class: none
Declaration: [1] function FindInArray (Value: integer; Arr: TIntArray): integer;
[2] function FindInArray (Value: string; Arr: TStrArray; IgnoreCase, SubStringSearch: boolean): integer;

The function FindInArray searches the 1-dimensional array Arr for the first element which matches Value and returns the index of the found element. In the case of a string search (version [2]) the additional parameter IgnoreCase controls whether the search is case-sensitive, and the additional parameter SubStringSearch controls whether a substring match is accepted.

The function returns the following error codes:

≥0 ... everything is OK, the returned number is the index of the found element
 -1 ... Arr has zero size
 -2 ... Value has not been found



Last Update: 2023-Feb-06