SelectedLine method (DataWindows)
Description
Obtains the number of the line that contains the insertion
point in an editable control.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control |
Web ActiveX |
DataWindow control |
Syntax
[PowerBuilder]
1 |
long <span>dwcontrol</span>.<span>SelectedLine</span> ( ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>SelectedLine</span> ( ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control. |
Return Values
Returns the number of the line containing the insertion point
in dwcontrol. If an error occurs, SelectedLine returns –1.
If dwcontrol is null, SelectedLine returns
null.
Usage
The insertion point can be at the beginning or end of the
selection. Therefore, SelectedLine can return
the first or last selected line, depending on the position of the
insertion point.

For use with other PowerBuilder controls, see SelectedLine in
the PowerScript Reference.
Examples
If the insertion point is positioned anywhere in
line 5 of the MultiLineEdit mle_Contact, the following
example sets li_SL to 5:
1 |
integer li_SL |
1 |
li_SL = mle_Contact.<span>SelectedLine</span>() |
In this example, the line the user selects in the
MultiLineEdit mle_winselect determines which window to
open:
1 |
integer li_SL |
1 |
li_SL = mle_winselect.<span>SelectedLine</span>() |
1 |
IF li_SL = 1 THEN |
1 |
Open(w_emp_data) |
1 |
ELSEIF li_SL = 2 THEN |
1 |
Open(w_dept_data) |
1 |
END IF |