Building Conditional Expressions

In programming, a conditional expression is a set of rules that are performed if a certain condition is met. Conditional expressions include one or more data sources, an operator, and a value.

In BarTender, conditional expressions are used with the When to Print dialog for conditional printing, with the When to Show dialog for data entry forms, with the Database Setup dialog's Multi-Database Join view for joining multiple databases and tables into a single record, in the Database Setup dialog's Filter view for creating custom filters, and in the Suppression dialog.

Complex expressions enable you to combine two or more conditions into a single expression. Even the most complex expressions are composed of simple expressions, which are then combined together with conditional joiners to create a final result.

Parts of a Conditional Expression

Simple conditional expressions are structured just like a sentence, namely "subject (data source)" "verb (operator)" "object (value)."

Building a Conditional Expression

To build a complex expression, you must know how to customize conditions, add conditions, and add groups of conditions. General instructions are as follows.

The user interface may vary within BarTender's conditional expression dialogs.

ClosedTo customize an existing expression

  1. Click the [Data Source] placeholder, and then click the named data source or database field that you want.

  2. Click the Operator placeholder, and then click the operator that you want to use.

  3. If appropriate, click <enter a value> to enter the value that you want.

ClosedTo add a new condition

Adding a new condition is a little different when you are creating database joins. For more information, refer to the Database Setup dialog.

  1. Next to the joiner that you want, click to add a new condition. Alternatively, if you are in the When to Print, When to Show, or Suppression dialog, you can click the joiner and then select Add Condition.

  2. Click the [Data Source] placeholder, and then click the named data source or database field that you want.

  3. Click the Operator placeholder, and then click the operator that you want to use. For more information about available operators and how they are used, refer to Conditional Printing.

  4. If appropriate, click <enter a value> to enter the value that you want.

ClosedTo add a new group of conditions

You cannot add groups of conditions when you are creating database joins.

  1. In the Tree View of the When to Print or When to Show dialog, click the conditional joiner to open the Conditional menu.

  2. Click Add Group. By default, the new conditional group is created with the And joiner and a single condition.

  3. Click the new joiner, and then select the joiner type that you want. For more information about available joiners and how they are used, refer to Conditional Printing.

  4. If you need more than one condition, click the icon. Alternatively, you can click the joiner and then select Add Condition from the Conditional menu to add conditions to the joiner.

Related Topics