Return the byte position of a formatted string based on line and column

     MLCTOPOS(<cText>, <nWidth>, <nLine>,
        <nCol>, [<nTabSize>], [<lWrap>]) --> nPosition


     <cText> is the text string to be scanned.

     <nWidth> is the line length formatting width.

     <nLine> is the line number counting from 1.

     <nCol> is the column number counting from 0.

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

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


     MLCTOPOS() returns the byte position within <cText> counting from 1.


     MLCTOPOS() is a memo function that determines the byte position that
     corresponds to a particular line and column within the formatted text.
     Note that the line number is one-relative and the column number is
     zero-relative.  This is compatible with MEMOEDIT().  The return value is
     one-relative, making it suitable for use in SUBSTR() or other string

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


     .  This example determines the byte position of line 5, column 3
        in the cText string:

        cText := "Note the side on which the bread ;
                    is buttered."
        ? MLCTOPOS(cText, 5, 3, 0)         // Result: 10

 Files   Library is CLIPPER.LIB.



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.