ATC()

From Lianjapedia
Revision as of 05:23, 29 September 2020 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Function to search for a substring (case insensitive)

Syntax

ATC(<expC1>, <expC2> | <memofield> [,<expN>])

See Also

AT(), AT_C(), ATLINE(), ATNEXT(), CHRTRAN(), CHRTRANC(), GETWORDCOUNT(), GETWORDNUM(), INLIST(), LEFT(), LEFTC(), LEN(), LENC(), OCCURS(), RAT_C(), RAT(), RIGHT(), RIGHTC(), SET STRESCAPE, STR(), STREXTRACT(), STRPOS(), STRTRAN(), STUFF(), STUFFC(), SUBSTR(), SUBSTRC()

Description

ATC() is the case insensitive substring search function. It returns a number signifying the starting position of <expC1> in <expC2> or in the specified memo field. If the substring is not contained within <expC2> or <memofield>, then the function returns the value 0. The leftmost character of a string is in character position 1. The ATC() function will return the starting position of the Nth occurrence of <expC1> when the optional numeric expression <expN> is specified. The ATC() function is particularly useful in conjunction with the LEFT() or SUBSTR() functions for locating starting points for extracting text from a string.

Example

? atc("IS", "Lianja is good") 
         8
cString1 = "IS"
cString2 = "Lianja is good" 
? atc(cString1, cString2)
         8