User guide
Creating a document using variable objects
Exercise: Creating a simple formula
Displaying the price of a product
In this example, the production label must show the price of the product as a function of its weight and the
price per kilogram.
1. Open a label. Two variables have to be created: WEIGHT and PRICEPERKG.
2. For the WEIGHT variable, enter 788 (the weight of the product is 788 g) as the Local value, enter ''Please
enter the weight in g'' in the Prefix field, then click OK.
3. For the PRICEPERKG variable, enter 15.70 (the price/kg is FF15.70) as the Local value of the variable, enter
''Please enter the price per kg'' in the Prefix field, then click OK.
4. Add a formula and name it Price.
5. Enter the formula WEIGHT*PRICEPERKG/1000, then click OK.
6. Save your label.
Exercise: Adding the "Warning" formula variable to display a warning message
In the following exercise, we will create a formula to display a warning message telling the user that the value
of the Total_Weight shared variable exceeds 1,000 kg.
If the weight value exceeds 1,000 kg, the message ''Attention! Error! Total Weight exceeds maximum!'' will
appear.
1. Open the label.
2. Create a formula and name it ''Warning''.
3. In the Formula dialog box, enter the following expression: if(Total_Weight>1000, ''Attention: Total Weight
exceeds maximum!'', '''')
4. On the Output tab, enter 50 in the Maximum length field and click OK.
5. Position the variable as text within the label.
6. In the Text dialog box, select Scalable as the font and set its Height to 12.70 mm.
7. On the Paragraph tab, select the Wordwrap option, then select Centered in the Alignment field.
Information on the IF function
The IF function returns one value if the condition you specify is TRUE, and another value if it is FALSE.
Use the IF function to carry out conditional tests on values and formulas.
Syntax
if("expr","val_if_true","val_if_false”) ”expr" represents any value or expression, the result of which can be TRUE
or FALSE.
val_if_true is the value returned if "expr" is TRUE. The val_if_true argument can be another formula.
val_if_false is the value returned if "expr" is FALSE. The val_if_false argument can be another formula.
31