| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Queries or changes the multi-pass mode for At***() functions.
CSetAtMuPa( [<lNewMode>] ) --> lOldMode
The function returns the previous multi-pass mode as a logical value.
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.
| 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 |
// 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
http://www.xHarbour.com