Modifies the data value of input fields in a RichTextEdit control.
RichTextEdit controls
rtename.InputFieldChangeData ( inputfieldname, inputfieldvalue )
Argument |
Description |
---|---|
rtename |
The name of the RichTextEdit control in which you want to change the data in the specified input fields. |
inputfieldname |
A string whose value is the name of input fields whose value you want to change. There can be more than one input field with a given name. |
inputfieldvalue |
A string whose value is the data to be assigned to the specified input fields. |
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is null, InputFieldChangeData returns null.
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.
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:
integer rtn
rtn = rte_1.InputFieldChangeData &
("instrument", lb_instruments.SelectedItem())
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.