RodinBangkok Posted May 15, 2004 Posted May 15, 2004 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.
The Shadow Posted May 15, 2004 Posted May 15, 2004 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.
Recommended Posts
This topic is 7759 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 accountSign in
Already have an account? Sign in here.
Sign In Now