Overview of the TextStatus object

Build 1501 on 14/Nov/2017  This topic last edited on: 9/May/2012, at 13:02

TextStatus object represents the typographical attributes of individual characters of a text, i.e. all the attributes that determine how a character will be printed: font, point size, color etc., similarly to what is achieved with the Ted.EditSetText command.

TextStatus object is implemented by TedLib.dll. It is possible create the TextStatus objects from any 32 bit application - including The Shell - but it useful only when editing a text, so only in Ted and Fred.

Note that it is not possible to create and use TextStatus object from the old 16 bit Ted and Fred.

About properties and validation methods

A TextStatus object has a number of properties, each one corresponding to a character typographical attribute. Each one of these properties can be set - modifying the corresponding attribute - or queried - returning the value of the corresponding attribute.

Each one of these properties can also be 'without value'. This happens when the corresponding typographical attribute has not been set, or it has multiple values, or it has been explicitely chosen as 'don't change' in a dialog.

Attempts to query the value of a property that does not have a value causes a run-time error during the execution of the script.

For each one of the properties there is a Boolean method that specifies if the corresponding property has a value. The methods names are the same of the properties, but prefixed with 'Has', so the FontCode property holds the code of the character's font and the HasFontCode methods returns true if FontCode has a value.

About validating assigned values

The values that are assigned to attribute properties are validated: attempts to assign invalid values causes run-time errors. So it is not possible to assign to the FontCode property the code of a non-existing font, or to the Color property the name of a non-existing color.