MLCTOPOS() Return the byte position of a formatted string based on line and column position ------------------------------------------------------------------------------ Syntax MLCTOPOS(<cText>, <nWidth>, <nLine>, <nCol>, [<nTabSize>], [<lWrap>]) --> nPosition Arguments <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.). Returns MLCTOPOS() returns the byte position within <cText> counting from 1. Description 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 functions. 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. Examples . 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.
See Also: MEMOEDIT() MLPOS() MPOSTOLC()