Determines the total number of characters in the selected text in an edit control, including spaces and line endings.
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 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.
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.
Using with other PocketBuilder controls
For use with other controls, see SelectedLength in the PowerScript
Reference.
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()
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |