4D v14.3ST INSERT EXPRESSION |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
ST INSERT EXPRESSION
ST INSERT EXPRESSION
The ST INSERT EXPRESSION command inserts a reference to the expression in the styled text field or variable designated by the object parameter. Passing the optional * parameter indicates that the object parameter is an object name (string). If you do not pass this parameter, it indicates that the object parameter is a field or variable. In this case, you pass a field or variable reference instead of a string (field or variable object only). In the expression parameter, you pass the 4D expression to evaluate in the object. A valid 4D expression is a string returning a value. expression can be a field, a variable, a 4D command, a statement returning a value, a project method, and so on. The expression must be placed in quotation marks (""). Note: The expression parameter cannot be a Picture type variable. If expression returns a value containing carriage returns and tabs, 4D formats the text according to the object hosting the expression; carriage return characters are interpreted as line breaks. You can format the expression by including formatting information in the expression parameter. In this case, the parameter must be in the form: "String(value;format)" ... where value contains the expression itself and format contains the format to apply. The format parameter can have the following values:
For example: "String([Table_1]Field_1;System date short)" By default, the expression values are displayed in the multi-style text areas. You can force the display of the references instead using the ST SET OPTIONS command. The optional startSel and endSel parameters designate a selection of text in object. The startSel and endSel values express a plain text selection, without taking into account any style tags that may be present.
4D provides predefined constants so that you can designate the selection limits automatically in the startSel and endSel parameters. These constants are found in the "Multistyle Text" theme:
(*) You must pass an object name in object to be able to use this constant. If you pass a reference to a field or variable, the command is applied to all the text of the object. Note: If startSel is greater than endSel (except when endSel is 0), the command does nothing and the OK variable is set to 0. You want to replace the highlighted text with the result of a project method: ST INSERT EXPRESSION(*;"myText";"MyMethod";ST Start highlight;ST End highlight) |
PROPERTIES
Product: 4D
HISTORY
SEE ALSO
ST FREEZE EXPRESSIONS ARTICLE USAGE
4D Language Reference ( 4D v14 R2) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||