xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

SetAtLike()

Sets the search mode for At***() functions

Syntax

SetAtLike( [<nNewMode>], [<cWildCard>] ) --> nOldMode

Arguments

<nNewMode>
This parameter specifies the search mode for At***() functions. Two numeric values are recognized:

Search modes for At***() functions
ValueDescription
0Searches exact match of search string
1Search string may contain wild card characters

<cWildCard>
Optionally, a single character can be specified as a wild card character. The default wild card character is a question mark (?). When a wild card character is included in the search string, it matches all characters in the searched string. Note that the asterisk (*) cannot be used as a wild card character.

Return

The function returns the previous SetAtAlike() mode as a numeric value.

Info

See also:AfterAtNum(), AtAdjust(), AtNum(), AtRepl(), BeforAtNum(), NumAt(), StrDiff()
Category: CT:String manipulation , Character functions
Source:ct\ctstr.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example uses function AtNum() to demonstrate wild card
// matching with SetAtLike().

   PROCEDURE Main
      LOCAL cStr := "Hello, Mister Miller"
      LOCAL nPos

      ? nPos := AtNum( "Miller", cStr )     // result: 15
      ? nPos := AtNum( "Mi??er", cStr )     // result: 0

      SetAtLike( 1 )
      ? nPos := AtNum( "Mi??er", cStr )     // result: 15
      ? SubStr( cStr, nPos )                // result: Miller

      ? nPos := AtNum( "Mi??er", cStr, 1 )  // result: 8
      ? SubStr( cStr, nPos )                // result: Mister Miller
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe