TextRange - DfBaseRichEdit
Returns text in given position range
Type: Function
Return Data Type: string
Parameters
| Parameter | Type | Description |
|---|---|---|
| iPositionStart | integer | The starting position of the text |
| iPositionEnd | integer | The ending position of the text |
Syntax
Function TextRange integer iPositionStart integer iPositionEnd Returns string
Call Example
Get TextRange iPositionStart iPositionEnd to stringVariable
Description
Returns the text between the starting and ending positions (iPositionStart and iPositionEnd).
The character position is the zero-based absolute position of the character in the control. The first position in the first line is always 0. If the first line in the control contains 20 characters, the first position in the second line will be 20.
Sample
This sample retrieves the text of a link in control oRichEdit1 that was clicked (OnLinkClicked fires when this happens). You can add your own handling of the link text in the begin...end code block.
Procedure OnLinkClicked integer iPositionStart integer iPositionEnd
string sLinkText
get TextRange of oRichEdit1 iPositionStart iPositionEnd to sLinkText
if (sLinkText <> "") begin
// do something
end
End_Procedure // OnLinkClicked
Return Value
Text between the starting and ending positions.