Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>rat()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
RAT()


Syntax:     RAT(<expC1>, <expC2>)

Purpose:    To search a character string for the last instance of a
            specified substring and return the starting position as a
            numeric value.

Arguments:  <expC1> is the character string to locate.

            <expC2> is the character string to be searched.

Returns:    An integer numeric value.

            If the substring is contained within the target expression,
            RAT() returns the starting character position of the
            substring.  If the substring is not found, RAT() returns
            zero.

Usage:      RAT() is similar to the AT() function except that scanning
            begins from the right therefore locating the last instance
            of the substring instead of the first instance.

Library:    EXTEND.LIB


----------------------------------- Example --------------------------------

   file_name = "C:\DBF\Sales.dbf"
   file_path = SUBSTR(name, 1, RAT("\", file_name))
   *
   ? file_path          && Result: C:\DBF\


See Also: AT() STRTRAN() SUBSTR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson