PWB Extensions Help (ext.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Search, REsearch
◄Up► ◄Contents► ◄Index► ◄Back►
─────PWB Extensions─────────────────────────────────────────────────────────
Syntax: int search( PFILE pFile,
flagType fForward, flagType fAll,
flagType fCase, flagType fWrap,
char far *Pattern, fl *pflStart );
int REsearch( PFILE pFile,
flagType fForward, flagType fAll,
flagType fCase, flagType fWrap,
char far *Pattern, fl *pflStart );
Returns: The length of the first match, or -1 if no match found.
See: Replace, ◄fl type► ◄Processing Text►
The search function finds for a specified string in a file. It uses
simple character-string matching and returns the length and
location of the match. REsearch searches for a regular expression.
The regular expression syntax is based on the current setting of
the Unixre switch.
See: ◄Unixre Switch► ◄Regular Expressions►
Note that these functions do not change the global search state
that is used by the Find and Replace commands on the Search menu.
Nor do they change the cursor position. To change the global search
state, you must get a pointer to the searchInfo struct by using
GetEditorObject with the RQ_SEARCHINFO request. You can then modify
the state directly. To change the cursor position, use MoveCur.
See: GetEditorObject, MoveCur
Argument Description
<pFile> The file to search.
<Pattern> String or regular expression.
<fForward> TRUE: Forward search from the specified location.
FALSE: Backward search.
<fAll> TRUE: PWB finds and highlights all occurrences.
FALSE: PWB finds the first match.
<fCase> TRUE: Search is case sensitive.
FALSE: Search is case insensitive.
<fWrap> TRUE: Search wraps around the ends of the file.
FALSE: Search stops at the ends of the file.
<pflStart> The location for the beginning of the search. The fl
record is updated with the location of the match if
one is found.
See: ◄fl type►
-♦-