Sfairadora

  • Reference Guide

rcf_ext_data

rcf_ext_data(value)
Creates a character format with the extension data attribute set to the value parameter (the type Seq(Cstyle_ext)). Sfairadora allows defining a text style that has extension data, which are provided by this function. In the current implementation, there is the only style supporting extension data named “hyperlink”. For this style, the extension data is a String containing a URL of the hyperlink target.
The parameter is basically a sequence of pairs. Every pair is made up by a style name that the data pertain to and the data. Nonetheless, the function rcf_ext_data does not provide the format with the style reference. It provides the extension data only, which has no function without the style reference. The style reference is created by the function rcf_style.
Example:
var Rich_cformat rcf = rcf_style("hyperlink") |
rcf_ext_data({{style: "hyperlink",
ext_type: Url,
ext_data: "http://www.diotima.eu"}});
var Rich_string dlink = set_cformat("Diotima", rcf);
This example creates the variable dlink that contains a foramtted string with a hyperlink to the Diotima web pages.

Structure Cstyle_ext

struct(String style,
Data_type ext_type
Union ext_data)
The style component determines the name of the style to that are data provided. The ext_type component determines the type of the data required by the style. The ext_data component contains the data. When specified, the ext_data must be of the type ext_type.

See Also