This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||
|
4D v20 R7
Programming Notes
|
4D v14 and higher | prior versions |
![]() | ![]() |
<span style="text-align:left;font-family:'Segoe UI';font-size:9pt;color:#0000FF">This is the word <span style="color:#D81E05">red</span></span> | <span style="font-family:'Segoe UI';font-size:9pt;text-align:left;font-weight:normal;font-style:normal;text-decoration:none;color:#0000FF;"><span style="background-color:#FFFFFF">This is the word red</span></span> |
The following generic commands are concerned:
OBJECT SET RGB COLORS
_o_OBJECT SET COLOR
OBJECT SET FONT
OBJECT SET FONT STYLE
OBJECT SET FONT SIZE
In the context of multi-style areas, generic commands should be used to set default styles only. To manage styles during database execution, we recommend using the commands of the "Styled Text" theme.
When it is used with a rich text area, the Get edited text command (Form Events theme) returns the text of the current area including any style tags.
To retrieve the "plain" text (text without tags) being edited, you must use the ST Get plain text command:
ST Get plain text(Get edited text)
Queries and sorts carried out among multi-style objects take into account any style tags saved in the object. If a style modification has been made within a word, searching for the word will not be successful.
To be able to carry out valid searches and sorts, you must use the ST Get plain text command. For example:
QUERY BY FORMULA([MyTable];ST Get plain text([MyTable]MyFieldStyle)="very well")
In order to ensure greater multi-platform compatibility of texts handled in the database, beginning with v14, 4D automatically normalizes line endings so that they occupy a single character: '\r' (carriage return). This normalization is carried out at the level of form objects (variables or fields) hosting plain or multi-style text. Line endings that are not native, or that use a mix of several characters (for example '\r\n'), are considered as a single '\r'.
Note that in compliance with the XML standard (multi-style text format), the multi-style text commands also normalize line endings for text variables that are not associated with objects.
This principle makes it easier to use multi-style text commands or commands such as HIGHLIGHT TEXT in a multi-platform context. However, you must take this into account in your processing when you work with texts from heterogeneous sources.
_o_OBJECT SET COLOR
OBJECT SET FONT
OBJECT SET FONT SIZE
OBJECT SET FONT STYLE
OBJECT SET RGB COLORS
Product: 4D
Theme: Styled Text
4D Language Reference ( 4D v20 R7)