Please enable JavaScript to view this site.

 

str = FormatText(sTextIn, sFormat, n32bitColor)

 

This macro function return sTextIn with markers that identify it as text that will be formatted using the format string sFormat, at a later stage, during diary generation.

 

This is an advanced function and that error checking is minimal.

 

Optionally, you can specify a color to be applied to the text, using the n32bitColor numerical value of a scanned color.

sDate = FormatText('[d]''B+, f Arial'2170914// black in scan

However, these numerical value are subject to change from one computer to the next, and we recommend that you always refer to the colors by name.

sDate = FormatText('[d]''B+, f Arial, COLOR(Black)'-1// -1 means no color

where the value of n32bitColor is set to -1 if we want it to be ignored.

 

sTextIn

This can be any text, even text that is the result of a previous call to the function FormatText (see the section on result, below, for more details). That is to say, formatting can be nested.

sFormat

Each specifier (see list in table below) is separated from the next by a comma (no space). Any value which can be specified in decimal form must use a period as decimal separator, regardless of the workstation's Windows settings. A sample sFormat would be:

'B+,I+,f Times New Roman'

The list of the various formats supported by this function is described here.

n32bitColor

This is the 32-bit value that uniquely represents any of the colors defined in the current GridTemplate. Note that this option remains for backwards compatibility, but you should now use functions which refer to a color by name, as in the example above, instead of its 32-bit representation.

result

The text result of this function will not be formatted text, but rather, plain text with markers that identify it for later processing.

sDate = FormatText('New Year''B+,I+,f Times New Roman', -1)

For example, the result of the above call to the function FormatText would be:

'**RICH1**New Year**TEXT1**'

At the same time a command is saved for later processing, to replace the string '**RICH1**New Year**TEXT1**' with 'New Year' in the formatting specified above.

 

If you need to get the plain text, without the markers, you can use the PlainTextOf function.

 

See also: FormatParagraph and simple text formatting.