This content has been marked as final. Show 8 replies
Furthermore, I don't think the following is allowed in FormCalc:
elseif ( 4001 < WEIGHT < 4500) then SHIP=13.50
I believe you have to use the following syntax:
elseif ( 4001 < WEIGHT & WEIGHT < 4500) then SHIP=13.50
When "4001 < WEIGHT" is evaluated, it amounts to a "true" or "false" value. Writing it the first way would essentially result in comparing "true" or "false" to 4500 which likely isn't what you want to do here.
The suggested way to write the expression boils-down to evaluating two boolean ("true" or "false") values together with an "and" operator which makes more sense (where the shipping cost is 13.50 only if the weight is both larger than 4001 and smaller than 4500).
This is most likely because you're assigning the value "POA" (a string) to a numeric field. Assigning a string value to a field which expects a numerical value always results in a translated numerical value of zero (0).
There are a few solutions I could suggest but I think the easiest one would be to use what's called a "compound" pattern for the Display Pattern property of the numeric field, located on the Object palette's Field tab.
Compound Display Patterns are patterns that include multiple "inner" patterns that tell a field how to display its data in different circumstances. For example, if the field's value (data) is null (no specified value -- not even zero), the field could display "POA" (text even though it's a numeric field). Otherwise, when the field's value is specified (not null), it could display it using a normal numeric pattern such as "$z,zz9.99".
So let's say you've already specified a Display Pattern of "$z,zz9.99" for the numeric field. You would change this Display Pattern into the following compound pattern:
Notice that the original Display Pattern has been preserved but now the compound pattern includes information on what to do when the field's value is null (not specified).
Given this compound pattern, when the postage goes above a given price, you would simply assign "null" as a value to the numeric field and it would automatically display a value of "POA" (even though it wouldn't actually have a value).
To set a field to null in FormCalc, you can do this:
NumericField1 = Null
NumericField1.rawValue = null;