Viva Clipper !

C5_MLPOS

Advertisements
 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()

 

Advertisements

Advertisements