Syntax 2 For RichTextEdit DataWindows
Description
Selects text beginning and ending at a line and character
position in a RichText DataWindow.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control |
Syntax
[PowerBuilder]
1 |
long <span>rtedwcontrol</span>.<span>SelectText</span> ( long <span>fromline</span>, long <span>fromchar</span>, long<span> toline</span>, long <span>tochar</span> { band <span>band</span> } ) |
Argument |
Description |
---|---|
rtedwcontrol |
A reference to the DataWindow control |
fromline |
A value specifying the line number where |
fromchar |
A value specifying the number in the |
toline |
A value specifying the line number where |
tochar |
A value specifying the number in the |
band (optional) |
A value of the Band enumerated datatype
The default is the band that contains the insertion point. |
Return Values
Returns the number of characters selected. A carriage return
with a line feed counts as a single character. If an error occurs SelectText returns –1. If
any argument’s value is null, it returns null.
Usage
The insertion point is at the “to” end of
the selection—that is, the position specified by toline and tochar.
If toline and tochar are
before fromline and fromchar,
then the insertion point is at the beginning of the selection.
You cannot specify 0 for a character position when making
a selection.
You cannot always use the values returned by Position to
make a selection. Position can return a character
position of 0 when the insertion point is at the beginning of a
line.
To select an entire line, set the insertion point and call SelectTextLine.
To select the rest of a line, set the insertion point and call SelectText with
a character position greater than the line length.

For use with other PowerBuilder controls, see SelectText in
the PowerScript Reference.
Examples
SelectText is used in the same
way for RichTextEdit controls and RichText DataWindow controls.
For sample code, see the examples for the RichTextEdit control in
the PowerScript Reference.