ReplaceText – PB Docs 150

ReplaceText method (DataWindows)

Description

Replaces selected text in the edit control for the current
row and column with a specified string.

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control

Web ActiveX

DataWindow control

Syntax

[PowerBuilder]

[Web ActiveX]

Argument

Description

editname

A reference to a DataWindow control

string

The string that replaces the selected
text

Return Values

Returns the number of characters in string and –1
if an error occurs.

If any argument’s value is null, in PowerBuilder
and JavaScript the method returns null.

Usage

If there is no selection, ReplaceText inserts
the replacement text at the cursor position.

To use the contents of the clipboard as the replacement text,
call the Paste method instead of ReplaceText.

note.png PowerBuilder environment

For use with other PowerBuilder controls, see ReplaceText in
the PowerScript Reference.

Examples

If the DataWindow edit control contains “Offer
Good for 3 Months” and the selected text is “3
Months”, this statement replaces “3 Months” with “60
Days” and returns 7. The resulting text in the edit control
is “Offer Good for 60 Days”:

If there is no selected text, this statement inserts “New
product” at the cursor position in the edit control for
dw_products:

See Also


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