SetAtLike()
Determine scan behaviour in some string functions
Syntax
SetAtLike ([<nMode>] [, <[@]cWildcard>]) --> nOldMode
Arguments
[<nMode>] :
CT_SetAtLike_EXACT -> characters are compared exactly
CT_SetAtLike_WILDCARD -> characters are compared using a wildcard character
The default value is CT_SetAtLike_EXACT.
[<[@]cWildcard>] determines the character that is subsequently used as a wildcard character for substring scanning. The default value is “?”.
NEW: If this parameter is passed by reference [@], the current wildcard character is stored in <cWildcard>.
Returns
nOldMode old (if nMode is a numeric value) or current state of the switch
Description
In the following CT3 functions, strings are compared on a character base:
ATADJUST(), ATNUM(), AFTERATNUM(), BEFOREATNUM(), ATREPL(), NUMAT(), STRDIFF()
With the SetAtLike function, one can determine when characters are considered to match within these functions. If CT_SetAtLike_WILDCARD is set (e.g. “?”), then “?” matches every other character.
<nMode> can be one of the following values that are defined in ct.ch
Definition | Value ----------------------|------ CT_SetAtLike_EXACT | 0 CT_SetAtLike_WILDCARD | 1
Compliance
This function is fully CT3 compatible, but allows to pass the second parameter by reference so that the current wildcard character can be determined.
Platforms
All
Files
Source is ctstr.c, header is ct.ch, library is ct3.
Pingback: Harbour String Functions | Viva Clipper !
Pingback: Harbour All Functions – S | Viva Clipper !