ScrollToRow  SelectedLine

Chapter 9: Methods for the DataWindow Control

SelectedLength

Description

Determines the total number of characters in the selected text in an edit control, including spaces and line endings.

Syntax

long dwcontrol.SelectedLength ( )

Argument

Description

dwcontrol

A reference to a DataWindow control. SelectedLength reports the length of the selected text in the edit control over the current row and column.

Returns

Returns the length of the selected text in dwcontrol. If no text is selected, SelectedLength returns 0. If an error occurs, it returns -1. If dwcontrol is NULL, the method returns NULL.

Usage

The characters that make up a line ending, produced by typing ctrl+enter or enter, are different on different platforms. On Windows, they are a carriage return plus a line feed and equals two characters when calculating the length. On other platforms, a line ending can be a single character. A line that wraps has no line-ending character.

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

Examples

Example 1

If the selected text in the DataWindow dw_Contact is John Smith, then this example sets the variable to 10, the number of selected characters:

integer li_length

li_length = dw_Contact.SelectedLength()

See also





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

View this book as PDF