July 4, 200421 yr 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.
July 4, 200421 yr Try: TextStyleAdd( someField; Evaluate(itemStyle) ) Bold and the like are named constants inside calculations, but have no special meaning inside a field.
July 5, 200421 yr Author 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 */
July 5, 200421 yr 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.
Create an account or sign in to comment