Extract a line of text from a character string or memo field

        [<lWrap>]) --> cLine


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


     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

     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.


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


     .  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)
        FOR nCurrentLine := 1 TO nLines
           ? MEMOLINE(CustNotes, nLineLength, nCurrentLine,;
                  nTabSize, lWrap)

 Files   Library is EXTEND.LIB.



One response to “C5_MEMOLINE

  1. Pingback: C5_TEXT | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.