Difference between revisions of "AT()"
Yvonne.milne (Talk | contribs) |
|||
(7 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
==See Also== | ==See Also== | ||
− | [[ATNEXT()]], [[GETWORDCOUNT()]], [[GETWORDNUM()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[SET STRESCAPE]], [[STR()]], [[STREXTRACT()]], [[STRPOS()]], [[STRTRAN()]], [[STUFF()]], [[SUBSTR()]] | + | [[AT_C()]], [[ATC()]], [[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== | ==Description== | ||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | ? at("is", " | + | ? at("is", "Lianja is good") |
− | + | 8 | |
cString1 = "is" | cString1 = "is" | ||
− | cString2 = " | + | cString2 = "Lianja is good" |
? at(cString1, cString2) | ? at(cString1, cString2) | ||
− | + | 8 | |
</code> | </code> | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | |||
[[Category:String Data Functions]] | [[Category:String Data Functions]] |
Latest revision as of 05:21, 29 September 2020
Contents
Purpose
Function to search for a substring
Syntax
AT(<expC1>, <expC2> | <memofield> [,<expN>])
See Also
AT_C(), ATC(), 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
AT() is the 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 AT() function will return the starting position of the Nth occurrence of <expC1> when the optional numeric expression <expN> is specified. The AT() function is particularly useful in conjunction with the LEFT() or SUBSTR() functions for locating starting points for extracting text from a string.
Example
? at("is", "Lianja is good") 8 cString1 = "is" cString2 = "Lianja is good" ? at(cString1, cString2) 8