Several new features are available in 4D v12.1 to give the developer more control over rich text areas (multi-style areas). The OBJECT SET PLAIN TEXT command has been added and the functioning of several existing commands has been modified.
Also note that several commands of the same theme now modify the OK variable.
The new OBJECT SET PLAIN TEXT command inserts plain text containing, for example, the <, > or & characters. This command complements the use of the OBJECT SET STYLED TEXT and OBJECT Get plain text commands.
The functioning of the following commands has been modified in 4D v12.1:
- FONT LIST: Under Mac OS, this command now populates the font array with the names of font families. In previous versions of 4D, this command returned the names of fonts themselves under Mac OS.
- OBJECT SET STYLED TEXT: You must pass rich text (styled) in the newText parameter. If you pass plain text that contains <, > or & characters, an error is generated. If you want to insert plain text containing any of these characters, you must use the new OBJECT SET PLAIN TEXT command.
Starting with version 12.1 of 4D, the following commands modify the OK system variable:
OBJECT SET STYLED TEXT ATTRIBUTES
OBJECT SET STYLED TEXT
OBJECT GET STYLED TEXT ATTRIBUTES
OBJECT Get plain text
OBJECT Get styled text
After these commands are executed, the OK variable is set to 1 if no error occurred and to 0 otherwise, it is set to 0. This is the case more particularly when style tags are not evaluated properly (incorrect or missing tags).
In the case of an error, the variable is not changed. When an error occurs on a variable when text is being evaluated, 4D transforms the text into raw text; as a result, the <, > and & characters are converted into HTML entities.