Links are not active on this page.
 RATLINE( ) Function

Returns the line number of the last occurrence of a character expression within another character expression or memo field, counting from the last line.

RATLINE(cSearchExpression, cExpressionSearched)

Parameters

cSearchExpression

Specifies the character expression that RATLINE( ) looks for in cExpressionSearched.

cExpressionSearched

Specifies the character expression that RATLINE( ) searches. The character expressions cSearchExpression and cExpressionSearched can be memo fields of any size.

Use MLINE( ) to return the line containing cSearchExpression.

NoteTip

RATLINE() offers a convenient way to search memo fields.

Expand imageReturn Value

Numeric

Expand imageRemarks

RATLINE( ), the reverse of the ATLINE( ) function, searches a character expression cExpressionSearched, starting with the last character in cExpressionSearched, for the occurrence of cSearchExpression.

If the search is successful, RATLINE( ) returns the number of the line where the match occurs. If the search is unsuccessful, RATLINE( ) returns 0.

The search performed by RATLINE( ) is case-sensitive.

Caution noteCaution

The line number that RATLINE() returns is determined by the value of SET MEMOWIDTH, even if cExpressionSearched isn't a memo field. For more information, see SET MEMOWIDTH.

Expand imageExample

In the following example, RATLINE( ) returns the line number for the last line in the notes memo field containing the word "graduated." MLINE( ) uses this value to return the contents of the line.

 CopyCode imageCopy Code
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'data\testdata')
USE employee  && Opens Employee table
STORE 'graduated' TO gcString
STORE MLINE(notes, RATLINE(gcString, notes)) TO gnFileLine
? gnFileLine

Expand imageSee Also