RAT C()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to search for a substring (double byte character sets)

Syntax

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

See Also

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

Description

The RAT_C() 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_C() function will return the starting position of the specified occurrence of <expC1> when the optional numeric expression <expN> is used. The RAT_C() function is particularly useful in conjunction with RIGHTC() or SUBSTRC() functions for locating starting points for text extraction.

Example

nPosition = rat_c(cDBString, cDBSearchString)