SelectedLength  SelectedStart

Chapter 9: Methods for the DataWindow Control

SelectedLine

Description

Obtains the number of the line that contains the insertion point in an editable control.

Syntax

long dwcontrol.SelectedLine ( )

Argument

Description

dwcontrol

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

Returns

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.

NoteUsing with other PocketBuilder controls For use with other controls, see SelectedLine in the PowerScript Reference.

Examples

Example 1

If the insertion point is positioned anywhere in line 5 of the MultiLineEdit mle_Contact, the following example sets li_SL to 5:

integer li_SL

li_SL = mle_Contact.SelectedLine()

Example 2

In this example, the line the user selects in the MultiLineEdit mle_winselect determines which window to open:

integer li_SL

li_SL = mle_winselect.SelectedLine()

IF li_SL = 1 THEN

		Open(w_emp_data)

ELSEIF li_SL = 2 THEN

		Open(w_dept_data)

END IF

See also





Copyright © 2004. Sybase Inc. All rights reserved. SelectedStart

View this book as PDF