Click or drag to resize

MLine3 Function

Extract a line of text from a string, specifying a required offset argument.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.5
Syntax
 FUNCTION MLine3(
	cString AS STRING,
	dwLine AS DWORD,
	ptrN REF DWORD
) AS STRING

Parameters

cString
Type: String
The string that contains the line of text.
dwLine
Type: UInt32
The line number to extract.
ptrN
Type: UInt32
<ptrN> must be a DWORD variable that is passed by reference.
At the end of the function call, <ptrN> will contain the offset of the last character of the returned line (cLineString).

Return Value

Type: String
The specified line.
If the specified line does not exist, the return value is NULL_STRING and <ptrN> contains a 0.
Remarks
MLine3() is similar to MLine(), except that all three arguments are required and it stores the offset of the last returned character with respect to the beginning of <cString>.  See MLine() for more information.
Examples
This example displays the content and the size of all lines in a character or memo field:
X#
1LOCAL dwOffset AS DWORD
2LOCAL dwLines AS DWORD
3LOCAL i AS DWORD
4dwLines := MemLines(_FIELD->Mail)
5FOR i := 1 UPTO dwLines
6    // Extract lines sequentially
7    ? MLine3(_FIELD->Mail, i, @dwOffset)
8    ? dwOffset            // Length of line
9NEXT
See Also