TextStyleAdd()

Category: Text Formatting

Syntax: TextStyleAdd ( text; style(s) )

Parameters:

textAny text string or expression that returns a text string.

styleAny named style or list of styles separated by a plus (+) sign, or an integer that represents a combination of styles. Named styles should not be placed in quotation marks and cannot be passed as field contents.

Data type returned: Text

Description:

Returns a text string that has the specified style(s) applied to it.

The style names are reserved keywords in FileMaker Pro and should not be placed within quotes. You also cannot place a keyword in a field and use the field as the style parameter within TextStyleAdd(). Styles can be specified as local variables within Let functions.

All the style names have numeric equivalents that you can use instead of the names. To combine multiple styles, simply add the numeric equivalents together. The numeric equivalent can be specified by a field, so use this method if you need to dynamically specify a text style.

The list of styles and their numeric equivalents is shown in Table 6.2:

Table 6.2. Style Names and Numeric Equivalent

Style Name

Numeric Equivalent

Plain

0

Strikethrough

1

Smallcaps

2

Superscript

4

Subscript

8

Uppercase

16

Lowercase

32

Titlecase

48

Wordunderline

64

Doubleunderline

128

Bold

256

Italic

512

Underline

1024

Condense

8192

Extend

16384

Allstyles

32767

Examples:

Function

Results

TextStyleAdd ("word underline."; WordUnderline)

Returns word underline.

TextStyleAdd ("bold italic!"; bold+italic)

Returns bold italic!.

TextStyleAdd ("Plain text"; Plain)

Removes all styles from the text. If the "Plain" style is combined with any other styles, "Plain" is ignored.

Категории