Set logic: Example

Set logic specifies which, how many and in what sequence forms can appear in a set. It also determines when a new set begins (called set break). Specify set logic in the Set definition dialog.

Level

Use Level to specify the hierarchy of forms in the set. When we fill in forms (tax forms, for example), we know that we cannot send in enclosures without a main form, or attachments to enclosures without the enclosures themselves. To FORMS, this is only apparent when we use Level to indicate it. In this example, the set consists of one main form and three enclosures, and the first enclosure can have two attachments:

Form structure

Level 

Main form

1

Enclosure 1

2

Attachment 1

3

Attachment 2

3

Enclosure 2

2

Enclosure 3

2

A set break always occurs at level 1 (and never at level 2 or level 3, for example).

Note: If you have a number of nearly identical forms to be processed at the same time and in exactly the same way, read about the Alias function.

From and To

After the level is defined, a number of details remain unclear: Can the main form be processed alone, or must enclosures be included? Can there be several attachments of the same type? These questions are answered by From and To, which specify the minimum and maximum number of forms of that type which are acceptable in the set.

Form structure

Level 

From 

To 

Main form

1

1

1

Enclosure 1

2

0

1

Attachment 1

3

1

1

Attachment 2

3

0

1

Enclosure 2

2

0

1

Enclosure 3

2

0

1

Here, the structure of the set is described by values indicating how many forms of each type are required and allowed. In this example, no more than or less than one Main form is acceptable; each Main form can be accompanied by not more than one enclosure of each type, but enclosures are not mandatory. If Enclosure 1 is present, then one Attachment 1 is mandatory, and up to one Attachment 2 is allowed.

At first glance, it may appear (because of the 1 under From) as if Attachment 1 were a mandatory component in the set. But the fact that Attachment 1 has Level 3 (under Enclosure 1) means that the From 1 is only valid if Enclosure 1 (which is higher up in the hierarchy) is present.

To specify that there is no limit to the number of forms allowed, type 999 under To. (In this field, 998 is a maximum number, but 999 indicates an infinite number of forms.)

Sequence

Even after From and To are specified, some details still remain unclear: Must the enclosures be in a specific sequence, or can they appear in any order? Can Attachment 2 come before Attachment 1? These questions are answered by Seq, which indicates whether the forms must appear in the sequence they are listed.

Form structure

Level 

From 

To 

Seq

Main form

1

1

1

¤

Enclosure 1

2

0

1

¤

Attachment 1

3

1

1

¡

Attachment 2

3

0

1

¡

Enclosure 2

2

0

1

¤

Enclosure 3

2

0

1

¤

In this example, the main form must be followed by enclosures in the listed order, but the attachments can occur in any order.

Now all the details about the structure of our sample set are specified. There will be a set break (the start of a new set) each time a new Main form is scanned.

Creating a new set definition

Set logic types

Editing set logic

Break expressions