| Function group | Execute on client | Platform(s) |
| String | YES | All |
style(textescape[,value1,value2])
Returns a style sequence suitable for embedding in styled text.textescape is a kEsc... constant; value1,value2 are suitable values for the particular textescape.Most escapes only need value1
Valid constants for the textescape are listed under 'Text escapes' in the Constants pane of the IDE Catalog window (there is also a group called 'JavaScript text escapes' for the JavaScript client). Depending on the textescape, you may also need to specify a value, which itself can be a constant. You can use this function to format the columns in a headed list box field; in this case, you can insert an icon by specifying its ID, change the text color, or set a text style such as italic.
Note that the alignment escapes (kEscCTab, kEscLTab and kEscRTab) are not designed to work with the headed list box. The headed list box method $setcolumnalign() can be used to set the alignment of a column.
The JavaScript client supports a subset of the standard text escapes, and some additional values specific to the JavaScript client, as documented by the following table:| kEscColor | In a client-executed method, the color parameter must be a numeric literal or constant. |
| kEscStyle | In a client-executed method, the style parameter must be a numeric literal or constant. |
| kEscBmp | In a client-executed method, the icon id parameter must be either a numeric literal, or the sum of a numeric literal and an icon size constant e.g. 1710+k48x48, or a character string followed by a size specification e.g. lock+16x16 |
| kEscJsNewline | No additional parameters are required. Inserts a <br> line break tag. There is also a new function br() which can be used as short-hand to do this. |
| kEscJsClose | No additional parameters are required. Closes the current open style information (inserted by kEscColor or kEscStyle) in the styled text and reverts to the original color and text style. Note - kEscColor and kEscStyle insert a <span> tag to style the text. kEscJsClose closes the <span> tag. |
| kEscJsHtml | Inserts raw HTML (the second parameter to style()). |
# to format the columns in a headed list box you could use the following calculation
Docon((lCol1,style(,1756),,lCol2,style(,),,lCol3,style(,))# give lCol1 a blue spot icon, lCol2 is red and lCol3 italic