Internet Direct (Indy) Version 9.0.1 Beta
PosInStrArray
Searches an array of strings for an occurrence of the search string.

function PosInStrArray(SearchStr: string; Contents: array of string; const CaseSensitive: Boolean): Integer;
Parameters
SearchStr: string
The value to find in the array of strings.

Contents: array of string
- The array of strings to be searched.

const CaseSensitive: Boolean = True
Use case sensitivity, Default value is True.

Returns
Integer - Position of the search string in the array, or -1 when not found.

Description
PosInStrArray is an Integer function used find the first occurrence of the search string specified in SearchStr in the array Contents.

The lower and upper limits of the array Contents is determined using the Low and High functions.

When CaseSensitive is True, the values in SearchStr and the current array element must be an exact match. When CaseSensitive is False, the function AnsiSameText is used to compare SearchStr to the string in the current array position.

The return value for the PosInStrArray function will be -1 if the search string does not exist in Contents.