[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             RATLINE             |
+---------------------------------+
RATLINE(<expC1>, <expC2>)

-----------------------------------
Searches expression for last occurrence of another expression and
returns line number of occurrence.
Return value - Numeric
-----------------------------------

RATLINE() searches a character expression, starting with the last
character, for the occurrence of another character expression.  If the
search is successful, the line number where the match occurs is
returned.  If the search is unsuccessful, 0 is returned.

The search performed by RATLINE() is case sensitive.

        . The line number returned by RATLINE() is affected by the value
assigned to the memo field width by SET MEMOWIDTH. The memo field width
determines the value returned by RATLINE() for character expressions
(character string literals, memory variables or array elements, or
database fields) as well as memo fields.

<expC1>, <expC2>
        RATLINE() searches <expC2> from its last character for <expC1>.
RATLINE() returns, as an integer, the line number where <expC1> was
found.  <expC1> and <expC2> may be memo fields.  The memo field line
containing the matching character expression may be returned as a
character string with MLINE().

+---------------------------------+
|         Program Example         |
+---------------------------------+
In this example,  RATLINE() returns line number in memo field COMMENTS
that contains string.  Text of this line is stored to memory variable
M_COMMENT.  (If there is no line containing string, null string is
returned by MLINE().)

CLOSE ALL
USE customer
STORE 'file' TO string
STORE MLINE(comments, RATLINE(string, comments)) TO m_comment
? m_comment

-----------------------------------

See Also:  AT(), ATLINE(), LEFT(), OCCURS(), RAT(), RIGHT(), SUBSTR()

-----------------------------------

See Also: AT() ATLINE() LEFT() OCCURS() RAT() RIGHT() SUBSTR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson