Topic Path: Symbol Reference > Functions > PosInStrArray Function
PosInStrArray Function

Searches an array of strings for an occurrence of the search string.

function PosInStrArray(
    const SearchStr: string; 
    Contents: array of string; 
    const CaseSensitive: Boolean = True
): Integer;
The value to find in the array of strings.
The array of strings to be searched.
Use case sensitivity, Default value is True. 

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

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 TextIsSame 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.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.