Internet Direct (Indy)
Home
PreviousUpNext
PosInStrArray Function

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

Pascal
function PosInStrArray(
    const SearchStr: string; 
    Contents: array of string; 
    const CaseSensitive: Boolean = True
): Integer;
Parameters 
Description 
SearchStr 
The value to find in the array of strings.
 
Contents 
The array of strings to be searched.
 
CaseSensitive 
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.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.