Description
Sets the type and type data of the text field in a RichTextEdit control.
Applies to
Syntax
rtename.TextFieldSetTypeAndData (integer id, string type, string typedata)
|
Argument |
Description |
|---|---|
|
rtename |
The name of the RichTextEdit control in which you want to set the type and type data of the text field |
|
id |
The ID of the text field to be set |
|
type |
The type of the text field to be set. The following types are supported now (the strings are case-insensitive):
|
|
typedata |
A string specifying the type data of the text field.
|
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. Returns -2 if the specified type is not supported.
If any argument's value is null, returns null.
Examples
This example inserts a text field (with a text value "Test") and sets an external link in the RichTextEdit rte_1:
integer li_rtn,li_id
li_id = rte_1.TextFieldInsert("Test")
li_rtn = rte_1.TextFieldSetTypeAndData (li_id,"externallink","https://www.appeon.com/")
MessageBox("TextFieldSetTypeAndData",string(li_rtn))
This example inserts a text field (with a text value "Go to page2") and sets an internal link in the RichTextEdit rte_1. When you click the text "Go to page2" in page1, the cursor will automatically jump to page2.
//On the opened RichTextEdit control page1, call TextFieldInsert to insert TextField "Go to page2".
ii_id= rte_1.TextFieldInsert("Go to page2")
//On page2, call TargetInsert to insert Target "Target01".
il_target_id= rte_1.TargetInsert("Target01",false)
//Call TextFieldSetTypeAndData to associate TextField "Go to page2" with Target "Target01".
li_rtn = rte_1.TextFieldSetTypeAndData (ii_id,"internallink","Target01")
You can also move cursor to Target "Target01" by clicking anywhere.
//Jump by the target ID
li_rtn = rte_1.TargetGoto(il_target_id)
//Or jump by the target name
li_rtn = rte_1.TargetGoto("Target01")See also


