SetAtLike()

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.

Advertisements

2 responses to “SetAtLike()

  1. Pingback: Harbour String Functions | Viva Clipper !

  2. Pingback: Harbour All Functions – S | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s