Difference between revisions of "AT()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
String Data
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to search for a substring
 
Function to search for a substring
Line 12: Line 8:
  
 
==See Also==
 
==See Also==
[[ATNEXT()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[STR()]], [[STREXTRACT()]], [[STRTRAN()]], [[STUFF()]], [[SUBSTR()]]
+
[[ATNEXT()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[SET STRESCAPE]], [[STR()]], [[STREXTRACT()]], [[STRPOS()]], [[STRTRAN()]], [[STUFF()]], [[SUBSTR()]]
  
  
Line 31: Line 27:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:String Data]]
 
[[Category:String Data]]
 
[[Category:String Data Functions]]
 
[[Category:String Data Functions]]

Latest revision as of 14:24, 21 July 2010

Purpose

Function to search for a substring


Syntax

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


See Also

ATNEXT(), INLIST(), LEFT(), OCCURS(), RAT(), RIGHT(), SET STRESCAPE, STR(), STREXTRACT(), STRPOS(), STRTRAN(), STUFF(), SUBSTR()


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", "Recital is good") 
         9
cString1 = "is"
cString2 = "Recital is good" 
? at(cString1, cString2)
         9


Products

Recital Server, Recital