4D v16.3ST Get content type |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
ST Get content type
ST Get content type
The ST Get content type command returns the type of content found 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). During execution, if the object has the focus, the command returns the information of the object being edited; if the object does not have the focus, the command returns the information of the object’s data source (variable or field). 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. The optional startBlock and endBlock parameters retrieve the position of the first and last character of the first homogenous block identified in the object or the selection of the object. For example, if the selection contains an expression and then plain text, startBlock and endBlock will return the limits of the expression. You can make a loop to process all the blocks of the selection. This command returns a value designating the type of contents identified. You can compare this value with the following constants, found in the "Multistyle Text" theme:
You want to display context-menu commands based on the type of contents selected in the area. Case of
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v14 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||