User manual
Designing Labels
Working with Variable Data
140
13857L-003 11/29/2011
Work with Visual Basic Expressions
Visual Basic expressions allows you to manipulate the data values on the label. Input to Visual
Basic can be fixed values or variable fields from the label. The output is always a data value
that is used as content for the current object.
The expression is a one-line Visual Basic script. You can use up to 100 characters for your
expression.
Note • The multi-line commands like "if..then..else.." cannot be used with the Visual Basic
expression. You can use one-line expressions.
A Visual Basic expression must follow the Visual Basic script programming syntax. For more
information on how to write your expressions, refer to the Microsoft help on Visual Basic
scripting. Click on the button ’VB Script Help’ in VB script step in the Text or Bar Code
wizard to open the Microsoft help.
Note • You can also open the Visual Basic reference help file VBS55.CHM in the Bin folder
of ZebraDesigner Pro folder.
Some common samples of Visual Basic expressions:
Visual Basic
Expression
The result Comment
1 + 4 * 20 81 Numeric calculation
"#" +
LEFT("123456
7890",5)
#12345 Working with string
functions
[MyField1] +
"-" +
[MyField2]
The values from variable
fields MyField1 and
MyField2 are merged
together.
Concatenating string
values