SelectedStart

Description

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

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control

Web ActiveX

DataWindow control

Syntax

PowerBuilder

long dwcontrol.SelectedStart ( )

Web ActiveX

number 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.

Returns

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.

NotePowerBuilder environment For use with RichTextEdit and other PowerBuilder controls, see SelectedStart in the PowerScript Reference.

Examples

Example 1

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