InputFieldChangeData PowerScript function
Description
Modifies the data value of input fields in a RichTextEdit
control.
Controls
RichTextEdit controls
Syntax
|
1 |
<span>rtename</span>.<span>InputFieldChangeData</span> ( <span>inputfieldname</span>, <span>inputfieldvalue</span> ) |
|
Argument |
Description |
|---|---|
|
rtename |
The name of the RichTextEdit control |
|
inputfieldname |
A string whose value is the name of input |
|
inputfieldvalue |
A string whose value is the data to be |
Return Values
Integer. Returns 1 if it succeeds and
-1 if an error occurs. If any argument’s value is null, InputFieldChangeData returns null.
Usage
All the input fields that have the same name contain the same
data. When you call InputFieldChangeData, you
affect all the fields of the specified name.
Examples
This script is part of the SelectionChanged event
for the ListBox lb_instruments. When
the user clicks on an item in the ListBox, the selected instrument
name is assigned to the input field called instrument in the RichTextEdit rte_1:
|
1 |
integer rtn |
|
1 |
rtn = rte_1.<span>InputFieldChangeData</span> & |
|
1 |
("instrument", lb_instruments.SelectedItem()) |
|
1 |
|
1 |
st_status.Text = String(rtn) |
If the text in rte_1 looks like this:
Dear {title} {lastname}:
We’re happy you have rented a {instrument} for
your child. Please perform regular maintenance for the {instrument} as
instructed by your child’s teacher. You can buy {instrument} supplies
and instruction books at your local music stores.
Then after the user picks trumpet in
the ListBox, the script inserts trumpet for every
occurrence of the {instrument} field. The other
fields are not affected:
Dear {title} {lastname}:
We’re happy you have rented a trumpet for
your child. Please perform regular maintenance for the trumpet as
instructed by your child’s teacher. You can buy trumpet
supplies and instruction books at your local music stores.