MLine Function (String, DWord, DWord) | |
Extract a line of text from a string, specifying an optional offset argument.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax FUNCTION MLine(
cString AS STRING,
nLine AS DWORD,
nOffset AS DWORD
) AS STRING
public static string MLine(
string cString,
uint nLine,
uint nOffset
)
Request Example
View SourceParameters
- cString
- Type: String
The string that contains the line of text. - nLine
- Type: DWord
The line number to extract. - nOffset
- Type: DWord
The position from which to extract characters.
An offset of 0 corresponds to the first byte in cString.
This is the default.
Alternatively, nOffset may be passed by reference (preceded by an @) in which case, after the function call, it will contain the size of the returned line.
Return Value
Type:
String
The specified line.
If the specified line does not exist, the return value is a NULL_STRING.
A new line begins when a hard-carriage return is encountered.
Remarks Examples
This example uses MLine(), to extract the first line that is past offset 10 (the 11th character).
1? MLine(Customer->Memos, 1, 10)
This example applies MLine() to a string that has two lines:
1? MLine(Space(30)+Chr(13)+Space(40), 1)
2
This example passes
nOffset by reference:
1nOffset := 0
2? MLine(Space(30)+Chr(13)+Space(40), 1, @nOffset)
3
4? nOffset
See Also