4D v12.4

OBJECT Get plain text

Home

 
4D v12.4
OBJECT Get plain text

 

OBJECT Get plain text 


 

OBJECT Get plain text ( {* ;} object ) -> Function result 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a variable or a field
object  Form object in Object name (if * is specified) or Variable or field (if * is omitted)
Function result  Text in Text without tags

The OBJECT Get plain text command removes any style tags from the text variable or field designated by the * and object parameters and returns the plain text. 

If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass this parameter, you indicate that the object parameter is a field or a variable. In this case, you pass a field or variable reference instead of a string.

Example  

You are looking for the text "very nice" among the values of a multistyle text field. The value was stored in the following form: "The weather is very nice today".

 QUERY BY FORMULA([Comments];OBJECT Get plain text([Comments]Weather)="@very nice@")

Note: In this context, the following statement will not give the desired result because the text is saved with style tags:

 QUERY([Comments];[Comments]Weather="@very nice@")

After this command is executed, the OK variable is set to 1 if no error occurred; 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 plain text; as a result, the <, > and & characters are converted into HTML entities.

 
PROPERTIES 

Product: 4D
Theme: Object Properties
Number: 1092

The OK variable is changed by the command

 
HISTORY 

New
Created: 4D v12
Modified: 4D v12.1

 
SEE ALSO 

OBJECT Get styled text
OBJECT SET PLAIN TEXT
OBJECT SET STYLED TEXT