Difference between revisions of "ATNEXT()"

From Recital Documentation Wiki
Jump to: navigation, search
(Class)
 
Line 1: Line 1:
 
 
 
==Purpose==
 
==Purpose==
 
Function to search a character string for the specified occurrence of a substring
 
Function to search a character string for the specified occurrence of a substring
Line 31: Line 29:
  
 
==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 16:00, 26 November 2009

Purpose

Function to search a character string for the specified occurrence of a substring


Syntax

ATNEXT(<expC1>, <expC2> [, <expN>])


See Also

AT(), INLIST(), LEFT(), OCCURS(), RAT(), RIGHT(), STR(), STREXTRACT(), STRTRAN(), STUFF(), SUBSTR()


Description

ATNEXT() is a substring search function which returns a number signifying the start position of a specified occurrence of <expC1> in <expC2>. The <expN> specifies the occurrence of <expC1> in <expC2>. The ATNEXT() function returns the value 0 if the specified occurrence does not exist. If <expN> is not specified, ATNEXT() checks for the first occurrence of <expC1>.

The leftmost character of a string is in character position 1. The ATNEXT() function is particularly useful in conjunction with the LEFT() or SUBSTR() functions for locating starting points for extracting text from a string.


Example

? atnext("is", "The fact is that Recital is good", 2)
        26
cString1 = "is" 
cString2 = "The fact is that Recital is good"
? atnext(cString1, cString2, 2)
        26


Products

Recital Server, Recital