| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Searches a value in the controlling index using wild card characters.
OrdWildSeek( <cWildCardString>, ;
[<lCurrentRec>] , ;
[<lBackwards>] ) --> lFound
The function returns .T. (true) if a record matching <cWildCardString> is found in the controlling index, otherwise .F. (false) is returned.
OrdWildSeek() searches a character string that may include wild card characters in the controlling index. This allows for collecting subsets of records based on an approximate search string. Records matching the search string are found in the controlling index, and the record pointer is positioned on the found record.
When a matching record is found, the function Found() returns .T. (true) until the record pointer is moved again. In addition, both functions, BoF() and EoF() return .F. (false).
If the searched value is not found, OrdWildSeek() positions the record pointer on the "ghost record" (Lastrec()+1), and the function Found() returns .F. (false), while Eof() returns .T. (true). The SET SOFTSEEK setting is ignored by OrdWildSeek().
| See also: | DbSeek(), LOCATE, OrdFindRec(), OrdKeyGoto(), WildMatch() |
| Category: | Database functions , Index functions , xHarbour extensions |
| Source: | rdd\dbcmd.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example uses two wildcard search strings to show
// possible search results of OrdWildSeek()
PROCEDURE Main
LOCAL aCust := {}
USE Customer
INDEX ON Upper(LastName) TO Cust01
DO WHILE OrdWildSeek( "*MAN?", .T. )
AAdd( aCust, FIELD->Lastname )
ENDDO
AEval( aCust, {|c| QOut(c) } )
// Found records:
// Dormann
// Feldman
GO TOP
aCust := {}
DO WHILE OrdWildSeek( "*EL*", .T. )
AAdd( aCust, FIELD->Lastname )
ENDDO
AEval( aCust, {|c| QOut(c) } )
// Found records:
// Feldman
// Hellstrom
// Keller
// Reichel
USE
RETURN
http://www.xHarbour.com