打开导航
In programming, a conditional expression is a set of rules that are performed if a certain condition is met. 条件表达式包括一个或多个数据源、一个运算符和一个值。
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 one or more conditions into a single expression. 即使是最复杂的表达式,也是由简单表达式通过条件连接符组合而成的最终结果。
条件表达式的构成
条件表达式的结构与句子类似,即“主语(数据源)”“动词(运算符)”“宾语(值)”。
-
数据源: This is the "subject" of the conditional expression. In BarTender, a typical data source may consist of something like a template name, a data source name, a table name, or the name of a field in a table.
-
运算符: This is the "verb" of the sentence. 运算符确定数据源与值之间的所需关系。 A typical operator is something like Equals, Does not equal, Is greater than, and so on.
-
值: This is the "object" of the sentence. 您输入或选择值来完成简单表达式。 A simple expression might look like "Template 1 Equals US Mail" or "Template 2 Does not equal UPS".
-
条件连接符: 条件连接符用于连接两个不同的条件语句,以构成新的条件并创建复杂表达式。 复杂表达式可能类似于“如果模板 1 等于 US Mail 并且模板 2 不等于 UPS”。
构建条件表达式
To build a complex expression, you must know how to customize conditions, add conditions, and add groups of conditions. General instructions are as follows.
|
BarTender 的条件表达式对话框内的用户界面可能有所不同。
|
自定义现有表达式
-
Click [Data Source], and then select the named data source or database field that you want from the list.
-
Click the Operator, and then select the operator that you want to use.
-
If appropriate, click <enter a value> to type in the Value that you want.
添加新条件
-
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 dialogs, you can click the joiner and then select
Add Condition.
-
Click [Data Source], and then select the named data source or database field that you want from the list.
-
Click the Operator, and then select the operator that you want to use. 有关可用运算符的完整列表以及这些运算符的使用方式,请参见根据条件打印概述。
-
If appropriate, click <enter a value> to type in the Value that you want.
添加一组新条件
-
In the Tree View of the When to Print or When to Show dialog, click the conditional joiner to open the Conditional menu.
-
单击
“添加组”。 默认情况下,将使用 AND 连接符和单个条件来创建新条件组。
-
Click the new joiner, and the select the joiner type that you want. For more information about the various joiners that are available and how they work, see Overview of Conditional Printing.
-
如果需要多个条件,请单击
图标。 Alternatively, you can click the joiner and then select
Add Condition from the Conditional menu to add conditions to the joiner.
相关主题