JavaScript Editor js editor     Web development 



Main Page

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.
Tip:
RATLINE() offers a convenient way to search memo fields.

Return Value

Numeric

Remarks

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:
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.

Example

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.

В Copy 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

See Also



JavaScript Editor js editor     Web development 
R7