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



DetectStringInFile


Unit:SDL_filesys
Class: none
Declaration: function DetectStringInFile (FName: string; SearchString: string; IgnoreCase: boolean; MaxLength: string): integer;

The function DetectStringInFile searches the text file of name FName for the presence of the string SearchString. The parameter IgnoreCase determines whether the search is case sensitive. The parameter MaxLength restricts the search in the file to the first MaxLength characters.

The function returns the position of the search string in the file, a zero value indicates that the search string is not present in the first MaxLength characters of the file.

Hint: Please note that this function is intended to be applied to text files only. Searching a binary file may return unexpected results.



Last Update: 2012-Oct-20