SelectedStart

Description

Reports the position of the first selected character in the edit control.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control


Syntax

PowerBuilder

long dwcontrol.SelectedStart ( )

Argument

Description

dwcontrol

A reference to a DataWindow control. It reports the starting position in the edit control over the current row and column.


Return value

Returns the starting position of the selected text in dwcontrol. If no text is selected, SelectedStart returns the position of the character immediately following the insertion point. If an error occurs, SelectedStart returns -1.

If dwcontrol is null, in PowerBuilder and JavaScript the method returns null.

Usage

SelectedStart counts from the start of the text and includes spaces and line endings.

PowerBuilder environment

For use with RichTextEdit and other PowerBuilder controls, see the section called “SelectedStart” in PowerScript Reference.

Examples

If the edit control for the DataWindow control dw_rpt contains Closed for Vacation July 3 to July 10, and Vacation is selected, then this example sets the variable to 12 (the position of the first character in Vacation):

integer li_Start
li_Start = dw_rpt.SelectedStart()

See also

Position

SelectedLength

SelectedLine