Progress
Report Builder
User’s Guide


R-INDEX

Returns an integer that indicates the position of the target string within the source string. In contrast to the INDEX function, the R-INDEX performs the search from right to left.

SYNTAX

R-INDEX ( source , target [ , starting ] ) 

source

A character expression (a constant, field name, or expression that results in a character value).

target

A character expression whose position you want to locate in source. If target does not exist within source, R-INDEX returns 0.

If a starting parameter is not specified, the search for the target pattern begins at the rightmost character. Even though the search is started from the right, the target position is calculated from the left. For example, this expression returns 3 rather than 2:

R-INDEX("abcd" , -c")  

starting

An integer that specifies the begin point for the search. This number must be a whole number greater than 0. For example, the following statement returns 1:

R-INDEX("abcdefabcdef",-abc",6) 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095