Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>mpostolc()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 MPOSTOLC()
 Return line and column position of a formatted string based on a specified
 byte position
------------------------------------------------------------------------------
 Syntax

     MPOSTOLC(<cText>, <nWidth>, <nPos>,
        [<nTabSize>], [<lWrap>]) --> aLineColumn

 Arguments

     <cText> is a text string.

     <nWidth> is the length of the formatted line.

     <nPos> is the byte position within text counting from one.

     <nTabSize> is the number of columns between tab stops.  If not
     specified, the default is four.

     <lWrap> is the word wrap flag.  If not specified, the default is
     true (.T.).

 Returns

     MPOSTOLC() returns an array containing the line and the column values
     for the specified byte position, <nPos>.

 Description

     MPOSTOLC() is a memo function that determines the formatted line and
     column corresponding to a particular byte position within <cText>.  Note
     that the line number returned is one-relative, the column number is
     zero-relative.  This is compatible with MEMOEDIT().  <nPos> is
     one-relative, compatible with AT(), RAT(), and other string functions.

     MPOSTOLC(), used with MLCTOPOS(), can create search routines or other
     text processing for MEMOEDIT().  Refer to the source code for the
     program editor (PE) found in \CLIPPER5\SOURCE\PE directory.

 Examples

     .  This example determines, for the text string shown, the line
        and column corresponding to the tenth character of the text, assuming
        a formatting width of five columns.  A formatting width of five would
        cause each of the first three words to be placed on a line by itself.
        The tenth character of the text is the "s" in "side."  The word
        "side" would be at the leftmost column of the third line of the
        formatted text, so the return value is {3, 0}:

        cText := "Note the side on which the bread ;
              is buttered."
        //
        aLC := MPOSTOLC(cText, 5, 10)         // Result: {3, 0}

 Files:  Library is CLIPPER.LIB.

See Also: MEMOEDIT() MLCTOPOS() MLPOS()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson