rogermax Posted July 4, 2004 Posted July 4, 2004 Using [color:"green"] TextStyleAdd(someField; Bold) works just fine to make the text in someField bold... When I try to make it dynamic and have a field named itemStyle where the user chooses from a list, Bold, Italic, etc. then use the syntax: [color:"green"] TextStyleAdd(someField; itemStyle) then it does not work. What am I missing? "Normally" we can pass the value of a field as a parameter. I checked to be sure that the result is text. I also tried using GetField("itemStyle") within the function, but no go.
The Shadow Posted July 4, 2004 Posted July 4, 2004 Try: TextStyleAdd( someField; Evaluate(itemStyle) ) Bold and the like are named constants inside calculations, but have no special meaning inside a field.
rogermax Posted July 5, 2004 Author Posted July 5, 2004 OK. I started nesting the functions as I want to be able to set the font, size, and style on the fly. The Calc is used in a SetField script step. The size and style work fine but I cannot get it to manipulate the font. I checked to make sure the font name taken from a list is spelled correctly and case sensitive. Can you see a flaw in what I have? /* Calc for setting the numbers with TextStyle, TextSize, and TextFont Dynamically set from the order page, fontStyle, fontSize, fontName */ TextFont( TextSize( TextStyleAdd( NUMBERS::someField; Evaluate(ORDERS::fontStyle) ); Evaluate(ORDERS::fontSize) ); Evaluate(ORDERS::fontName) ); ) /* End Calc */
The Shadow Posted July 5, 2004 Posted July 5, 2004 I don't think you need to Evaluate the fontSize or fontName, the fontSize is just a number and the fontName is just a string - so those two will work without Evaluate() on them.
rogermax Posted July 5, 2004 Author Posted July 5, 2004 Apparently the Shadow does know... that did the trick. thanks for the help.
Recommended Posts
This topic is 7708 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