May 15, 200421 yr 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.
May 15, 200421 yr 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.
Create an account or sign in to comment