Function OrdWildSeek() Foundation

Search for a single or subset of records matching a specific wildcard pattern.

Syntax
OrdWildSeek( <cSkeletonExpr> ) --> lMatch
OrdWildSeek() -> nRecord
Parameters
<cSkeletonExpr>
Specifies the character expression to be searched for in the active index of the current work area. <cSkeletonExpr> can contain wildcards such as * and ?. The question mark (?) matches any single character and the asterisk (*) matches any number of characters. Any number of wildcards in any combination can be mixed in <cSkeletonExpr>.
Return

The function OrdWildSeek( <cSkeletonExpr> ) returns .T. (true) if one or more records matching the <cSkeletonExpr> could be found in the active index of the current work area.

The function OrdWildSeek() navigates to the next record of the current table matching the initial search condition. If no more records could be found the function OrdWildSeek() returns .F. (false) and navigates to the ghost record.

Description

The function OrdWildSeek() can be used to efficiently determine subsets of a work area based on an index and search pattern. The function OrdWildSeek() uses the active index of the current work area for its search operation. A runtime error is raisen if the index is not of character type.

If the function OrdWildSeek( <cSkeletonExpr> ) return .T. it has succesfully found one or more matching records. Found() returns .T. (true) in that case, and the record pointer of the current workarea is positioned to the first matching record.

Subsequent calls of OrdWildSeek() without any parameter advance the record pointer to the next matching record and return .T. (true). If the last matching record is reached a call to OrdWildSeek() will return .F. (false) and the record pointer is positioned at the ghost record.

If the function OrdWildSeek( <cSkeletonExpr> ) does not find any matching record, it does not reposition the record pointer and returns .F. (false).

OrdWildSeek() is supported by the NTXDBE and CDXDBE DatabaseEngines only. If used with other DBEs a runtime error "Operation not supported" is generated.

Examples
OrdWildSeek()
PROCEDURE Main 

  USE Customer 
  INDEX ON LASTNAME TO LAST.NTX 

  ? OrdWildSeek("Wa*r?")   // result: .T. 
  ? "DbFound:",Found()     // result: .T. 

  // result: 
  // Hit:               6 Key: Walter 
  // Hit:              22 Key: Waters 
  DO WHILE Found() 
    ? "Hit:",RecNo(),"Key:",&(OrdKey()) 
    OrdWildSeek() 
  ENDDO 
  CLOSE ALL 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.