C5_MLPOS

 MLPOS()
 Determine the position of a line in a character string or memo field
------------------------------------------------------------------------------
 Syntax

     MLPOS(<cString>, <nLineLength>,
        <nLine>, [<nTabSize>], [<lWrap>]) --> nPosition

 Arguments

     <cString> is a character string or memo field.

     <nLineLength> specifies the number of characters per line.

     <nLine> specifies the line number.

     <nTabSize> defines the tab size.  The default is four.  If
     <nTabSize> is greater than or equal to <nLineLength>, then the tab size
     is adjusted to <nLineLength> - 1.

     <lWrap> toggles word wrap on and off.  Specifying true (.T.) toggles
     word wrap on, and false (.F.) toggles it off.  The default is true
     (.T.).

 Returns

     MLPOS() returns the character position of <nLine> in <cString> as an
     integer numeric value.  If <nLine> is greater than the number of lines
     in <cString>, MLPOS() returns the length of <cString>.

 Examples

     .  This example uses MLPOS() to find the position of a specific
        line, given a line length:

        cString = MEMOREAD("Temp.txt")
        nLineLength = 40
        nLine = 5
        nPosition = MLPOS(cString, nLineLength, nLine)
        ? SUBSTR(cString, nPosition, 12)

 Files   Library is EXTEND.LIB.

See Also: MEMOLINE() MEMOTRAN() MLCOUNT()

 

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.