Assignment Operators

The Visual Basic used for "Single-Line Expression" is a simplified form invented by the manufacturer of BarTender to make Visual Basic more accessible to non-programmers. A single-line expression is, however, only a partial line of Visual Basic and cannot be used in a Multi-line script. Multi-line scripts require that the result of any function, expression or other operation be "assigned" to a variable. For example:

Value = Trim(Field("part_number")) & Field("price")

This example takes the "part_number" field from the current database record, removes all trailing spaces, and appends (or "concatenates") the price of the part onto the end of the part number. The resulting combined data is then assigned to the variable named "Value."