Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 2 For RichTextEdit controls and presentation styles – PB Docs 150 – PowerBuilder Library

Syntax 2 For RichTextEdit controls and presentation styles – PB Docs 150

Syntax 2 For RichTextEdit controls and presentation styles

Description

Selects text beginning and ending at a line and character
position in a RichTextEdit control.

Controls

RichTextEdit and DataWindow controls

Syntax

Argument

Description

rtename

The name of the RichTextEdit or DataWindow
control in which you want to select text. The DataWindow object
in the DataWindow control must be a RichTextEdit DataWindow.

fromline

A long specifying the line number where
the selection starts.

fromchar

A long specifying the number in the line
of the first character in the selection.

toline

A long specifying the line number where
the selection ends. To specify an insertion point, set toline and tochar to
0.

tochar

A long specifying the number in the line
of the character before which the selection ends.

band (optional)

A value of the Band enumerated datatype
specifying the band in which to make the selection. Values are:

  • Detail!

  • Header!

  • Footer!

The default is the band that contains the insertion point.

Return Values

Long. 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.

Examples

This statement selects text from the first character
in the RichTextEdit control to the fourth character on the third
line:

This statement sets the insertion point at the beginning
of line 2:

This example sets the insertion point at the end
of line 2 by specifying a large number of characters. The selection
highlight extends past the end of the line:

This example sets the insertion point at the end
of line 2 by finding out how long the line really is. The code moves
the insertion point to the beginning of the line, gets the length,
and then sets the insertion point at the end:

This example selects the text from the insertion
point to the end of the current line. If the current line is the
last line, the reported line length is 1 greater than the number
of character you can select, so the code adjusts for it:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x