Returns a specific line from a memo field as a character string.
Syntax
MLINE(MemoFieldName, nLineNumber [, nNumberOfCharacters])
Returns
Character
Arguments
MemoFieldName
Specifies the name of the memo field from which MLINE( ) returns a line. If the memo field is in a table open in a noncurrent work area, preface the memo field name with a period and the table alias.
nLineNumber
Specifies the number of the line to be returned from the memo field. An empty string is returned if nLineNumber is negative, 0, or greater than the number of lines in the memo field.
nNumberOfCharacters
Specifies the number of characters from the beginning of the memo field after which MLINE( ) returns the specified line.
The _MLINE system variable is typically used for nNumberOfCharacters. _MLINE is automatically adjusted each time MLINE( ) is called.
In recursive procedures that return lines from large memo fields, you can obtain the best performance by including _MLINE as nNumberOfCharacters.
Remarks
MLINE( ) trims any trailing spaces from the line specified with nLineNumber.
The length and number of the lines in a memo field are determined by the current value of SET MEMOWIDTH (the default line length is 50 characters). If a carriage return is encountered, no additional characters are returned. The current _WRAP setting determines how the memo field line is displayed.
When searching a memo field for a character string, you can use ATLINE( ) or ATCLINE( ) to return the line number of the line in which the character string is found. Use this line number in MLINE( ) to return the contents of the line from the memo field.