Parentheses (Collections)

Member of:

Limits collection, AppendQueries collection

Description:

A collection of parentheses attributes for a limit value or appended query object.

To nest parentheses between limit items, add parentheses around the largest range of limit objects before nesting additional parentheses. For example, if State, Amount Sales, and City are on the limit line, type:

ActiveDocument.Sections["Query"].Limits.Parentheses.Add("State", "City")

before typing:

ActiveDocument.Sections["Query"].Limits.Parentheses.Add("State", "Amount Sales")

Tip:

All collections have the “Item(NameOrIndex)” method. This is the default method for all collections that returns a collection item at a particular index or that has a specific name. Use brackets ([]) to represent calls to the Item (Method). For example, these statements are identical: myItem = Documents[1] myItem = Documents.Item(1) myItem = Documents["StartUp.bqy"] myItem = Documents.Item("StartUp.bqy")

Example 1:

This example shows how to remove all parentheses attributes set on the values of the limit line:

ActiveDocument.Sections["Query"].Limits.Parentheses.RemoveAll()

Example 2:

This example shows how to add parentheses:

ActiveDocument.Sections["Query"].Limits.Parentheses.Add("State"), "City")

Example 3:

This example shows how to add parentheses between the first query and the second query:

var firstQuery = ActiveDocument.Sections["Query"].AppendQueries.Item(1);
var secondQuery = ActiveDocument.Sections["Query"].AppendQueries.Item(2);
ActiveDocument.Sections["Query"].AppendQueries ["UnionParentheses"].Add(firstQuery, secondQuery);

Methods:

Add(BeginLimit as String, EndLimit as String) or Add(AppendQuery BeginQuery, AppendQuery EndQuery), Item(Value as NameOrIndex), RemoveAll()

Properties:

Read-only: Count as Number

Objects:

Parenthesis object