Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7496 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I can't seem to get the TextStyleAdd function to recognize styles when referenced from a text field, placing the style directly in the function works fine, but referencing a field produces no change.

Am I missing something?

Here's the Calc I'm using basically taken from the example in Help:

TextStyleAdd ( TextStyleAdd ( FormatText::Txt1 ; Plain ) ; FormatText::FontStyle)

Where FormatText::FontStyle is a text field.

Posted

The styles are not text strings, they are numbers, the calculation is interpreting them as named constants.

If you play around with it a little, you'll notice:

Plain = 0

SmallCaps = 2

TitleCase = 48

Bold = 256

Italic = 512

etc.

So, when the help example states:

TextStyleAdd( titleField; SmallCaps + TitleCase )

you could instead use:

TextStyleAdd( titleField; 2 + 48 )

as well.

You could make your calculation work the way you'd like by changing it to:

TextStyleAdd ( TextStyleAdd ( FormatText::Txt1 ; Plain ) ; Evaluate( FormatText::FontStyle) )

and Evaluate() will determine the correct style-number from the name given.

This topic is 7496 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.