[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
MEMOLINE()
Extract a line of text from a character string or memo field
------------------------------------------------------------------------------
Syntax
MEMOLINE(<cString>,
[<nLineLength>],
[<nLineNumber>],
[<nTabSize>],
[<lWrap>]) --> cLine
Arguments
<cString> is the memo field or character string from which a line of
text is to be extracted.
<nLineLength> specifies the number of characters per line and can be
between four and 254. If not specified, the default line length is 79.
<nLineNumber> is the line number to be extracted. If not specified,
the default value is one.
<nTabSize> defines the tab size. If not specified, the default
value is four. If <nTabSize> is greater than or equal to <nLineLength>,
then the tab size is automatically converted to <nLineLength> - 1.
<lWrap> toggles word wrap on and off. Specifying true (.T.) toggles
word wrap on; false (.F.) toggles it off. If not specified, the default
value is true (.T.).
Returns
MEMOLINE() returns the line of text specified by <nLineNumber> in
<cString> as a character string. If the line has fewer characters than
the indicated length, the return value is padded with blanks. If the
line number is greater than the total number of lines in <cString>,
MEMOLINE() returns a null string ("").
If <lWrap> is true (.T.) and the indicated line length breaks the line
in the middle of a word, that word is not included as part of the return
value but shows up at the beginning of the next line extracted with
MEMOLINE().
If <lWrap> is false (.F.), MEMOLINE() returns only the number of
characters specified by the line length. The next line extracted by
MEMOLINE() begins with the character following the next hard carriage
return, and all intervening characters are not processed.
Description
MEMOLINE() is a memo function used with MLCOUNT() to extract lines of
text from character strings and memo fields based on the number of
characters per line. It is the most basic facility provided by
CA-Clipper to display memo fields and long strings.
The basic method of operation is to determine the number of lines in the
memo field or character string using MLCOUNT() with the same number of
characters per line, tab size, and wrapping behavior as you intend to
use with MEMOLINE(). Using this value as the upper boundary of a
FOR...NEXT, each line of the memo field or character string can be
extracted with MEMOLINE() and processed with any combination of output
commands and functions required.
Examples
. This example demonstrates the general method for displaying
memo fields and long character strings using the combination of
MLCOUNT() and MEMOLINE():
LOCAL nLineLength := 40, nTabSize := 3, lWrap := .T.
LOCAL nLines, nCurrentLine
USE Customer INDEX CustName NEW
//
nLines := MLCOUNT(CustNotes, nLineLength,;
nTabSize, lWrap)
//
SET PRINTER ON
FOR nCurrentLine := 1 TO nLines
? MEMOLINE(CustNotes, nLineLength, nCurrentLine,;
nTabSize, lWrap)
NEXT
SET PRINTER OFF
Files Library is EXTEND.LIB.
See Also:
MEMOEDIT()
MLCOUNT()
MLPOS()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson