Topic Path: Symbol Reference > Classes > TIdBuffer Class > TIdBuffer Methods > IndexOf Method > IndexOf Method (string, Integer)
ContentsIndexHome
PreviousUpNext
TIdBuffer.IndexOf Method (string, Integer)

Determines the index position of a value in the buffer.

function IndexOf(
    const AString: string; 
    AStartPos: Integer = 0
): Integer; overload;
Parameters 
Description 
AString 
Value to locate in the buffer.
 
AStartPos 
Offset into the buffer to begin looking for the specified value. Default value is 0. 

Integer - Zero-based offset of the desired value in the buffer, or -1 when the value is not found.

IndexOf is an overloaded Integer function used to determine the index position where the value in AString occurs in the buffer. 

IndexOf calls the ToBytes function to obtain a TIdBytes instance representing the value in AString, and calls the overloaded IndexOf method using the TIdBytes value. 

The return value for the method will contain -1 when AString cannot be located in the internal storage for the buffer, or the zero-based offset of the desired value in the buffer.

TIdBuffer.IndexOf ToBytes 

TIdBytes

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