FormatText

Navigation:  Appendices > Macro Language > Built-in Functions > All Functions (Alphabetical) >

FormatText

Previous pageReturn to chapter overviewNext page

str = FormatText(sTextIn, sFormat, n32bitColor)

 

This macro function return sTextIn with markers that identify it to be formatted by Q++ during diary generation according to the formatting string sFormat. Some important remarks:

 

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 instead of its 32-bit representation.

result

The text result of this function will not be formatted text (yet), but rather, plain text with markers that identify it for Q++ processing later. For example, the result of a call to the present function may give:

 

**RICH12**New Year**TEXT12**

 

Note that you can change the text inside the markers (New Year, in the above example) but the markers themselves should not be changed. If you need to get the plain text, without the markers, you can use the PlainTextOf function.

 

Note that this is an advanced function and that error checking is minimal. For example, you will get no warning if sFormat contains the same attributes repeated with a different values (eg. f Arial and f Garamond) or with inherently conflicting different attributes (eg: hs90,vs75), or refer to a non-existent color name.


Topic 177845 updated on 29-Mar-2017.
Topic URL: http://www.qppstudio.net/webhelp/index.html?formattext.htm