xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

CSetAtMuPa()

Queries or changes the multi-pass mode for At***() functions.

Syntax

CSetAtMuPa( [<lNewMode>] ) --> lOldMode

Arguments

<lNewMode>
Optionally, a logical value can be passed. .T. (true) switches the multi-pass mode on, while .F. (false) switches it off.

Return

The function returns the previous multi-pass mode as a logical value.

Description

The multi-pass mode is initially set to .F. (false) and can be switched on by passing .T. (true). The following At***() functions recognize the multi-pass mode: AfterAtNum(), AtNum(), AtRepl(), BeforAtNum(), NumAt(), WordToChar() and WordRepl().

If the multi-pass mode is On, these functions process a character string repeatedly until no further match can be found for a search condition.

Info

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

Example

// The example demonstrates the effect of the multi-pass mode
// with function NumAt(). When the multi-pass mode is Off, the
// search continues at <nPos>+Len(<cSearch>), so that the search
// string is found only 2 times. When the mode is On, the search
// continues at <nPos>+1, so that the search string is found 4 times.

   PROCEDURE Main
      LOCAL cString := "aabbbbbccc"

      CSetAtMuPa( .F. )
      ? NumAt( "bb", cString )   // result: 2
      //      2_
      //  aabbbbbccc
      //    1_

      CSetAtMuPa( .T. )
      ? NumAt( "bb", cString )   // result: 4
      //     2_4_
      //  aabbbbbccc
      //    1_3_
   RETURN

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