Difference between revisions of "RAT()"

From Lianjapedia
Jump to: navigation, search
 
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to search for a substring
 
Function to search for a substring
 
  
 
==Syntax==
 
==Syntax==
 
RAT(<expC1>, <expC2> | <memofield> [, <expN>])
 
RAT(<expC1>, <expC2> | <memofield> [, <expN>])
 
  
 
==See Also==
 
==See Also==
[[AT()]], [[ATNEXT()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RIGHT()]], [[SET STRESCAPE]], [[STR()]], [[STREXTRACT()]], [[STRTRAN()]], [[STUFF()]], [[SUBSTR()]]
+
[[AT()]], [[AT_C()]], [[ATNEXT()]], [[CHRTRAN()]], [[CHRTRANC()]], [[INLIST()]], [[LEFT()]], [[LEFTC()]], [[LEN()]], [[LENC()]], [[OCCURS()]], [[RAT_C()]], [[RIGHT()]], [[RIGHTC()]], [[SET STRESCAPE]], [[STR()]], [[STREXTRACT()]], [[STRLEN()]], [[STRTRAN()]], [[STUFF()]], [[STUFFC()]], [[SUBSTR()]], [[SUBSTRC()]]
 
+
  
 
==Description==
 
==Description==
 
The RAT() function is a substring search function.  It will search <expC2>  or the specified memo field for the last occurrence of <expC1>  and return the starting position as a numeric value.  If the substring is not contained within the second character expression or memo field, then the function returns the value 0.  The leftmost character of a string is in character position 1.  The RAT() function will return the starting position of the specified occurrence of <expC1> when the optional numeric expression <expN> is used.  The RAT() function is particularly useful in conjunction with RIGHT() or SUBSTR() functions for locating starting points for text extraction.
 
The RAT() function is a substring search function.  It will search <expC2>  or the specified memo field for the last occurrence of <expC1>  and return the starting position as a numeric value.  If the substring is not contained within the second character expression or memo field, then the function returns the value 0.  The leftmost character of a string is in character position 1.  The RAT() function will return the starting position of the specified occurrence of <expC1> when the optional numeric expression <expN> is used.  The RAT() function is particularly useful in conjunction with RIGHT() or SUBSTR() functions for locating starting points for text extraction.
 
  
 
==Example==
 
==Example==
Line 20: Line 16:
 
         7
 
         7
 
cString1 = "fa"
 
cString1 = "fa"
cString2 = "Recital is fast"
+
cString2 = "Lianja is fast"
 
? rat(cString1, cString2)
 
? rat(cString1, cString2)
         12
+
         11
 
?rat("Step", notes, 8)
 
?rat("Step", notes, 8)
 
         24
 
         24
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:String Data]]
 
 
[[Category:String Data Functions]]
 
[[Category:String Data Functions]]

Latest revision as of 07:22, 15 September 2014

Purpose

Function to search for a substring

Syntax

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

See Also

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

Description

The RAT() function is a substring search function. It will search <expC2> or the specified memo field for the last occurrence of <expC1> and return the starting position as a numeric value. If the substring is not contained within the second character expression or memo field, then the function returns the value 0. The leftmost character of a string is in character position 1. The RAT() function will return the starting position of the specified occurrence of <expC1> when the optional numeric expression <expN> is used. The RAT() function is particularly useful in conjunction with RIGHT() or SUBSTR() functions for locating starting points for text extraction.

Example

? rat("is", "is is is")
         7
cString1 = "fa"
cString2 = "Lianja is fast"
? rat(cString1, cString2)
        11
?rat("Step", notes, 8)
        24