Skip to content

TextRange - DFBaseTextEdit

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 in a range of positions in control oTextEdit1 and displays it to the user in a message box.

Procedure DisplayTextInRange integer iPositionStart integer iPositionEnd
    string sText

    get TextRange of oTextEdit1 iPositionStart iPositionEnd to sText

    if (sText <> "") ;
        send Info_Box sText ("Text in range " + string(iPositionStart) + " to " + string(iPositionEnd))
End_Procedure  // DisplayTextInRange

Return Value

Text between the starting and ending positions.