QueryCriteria Collection Methods

In this section, we discuss the QueryCriteria collection methods. The methods are discussed in alphabetical order.

Syntax

First()

Description

The First method returns the first QueryCriteria object in the QueryCriteria collection.

Parameters

None.

Returns

A reference to a QueryCriteria object if successful, NULL otherwise.

Example

&MyQueryCriteria = &MyCollection.First();

Syntax

Item(number)

Description

The Item method returns the QueryCriteria object that exists at the number position in the QueryCriteria collection.

Parameters

Field or Control

Definition

Number

Specify the position number in the collection of the QueryCriteria object that you want returned.

Returns

A reference to a QueryCriteria object if successful, NULL otherwise.

Example

For &I = 1 to &MyCollection.Count; 
   &MyQueryCriteria = &MyCollection.Item(&I); 
   /* do processing */ 
End-For;

Syntax

ItemByName(CriteriaName)

Description

The ItemByName method returns the QueryCriteria object that exists with the passed CriteriaName in the QueryCriteria collection.

Parameters

Field or Control

Definition

CriteriaName

Specify the name of the Criteria to be searched. This name is the same as the one used while creating the criteria using QuerySelect.AddCriteria(CriteriaName).

Returns

A reference to a QueryCriteria object if successful, NULL otherwise.

Example

&MyQueryCriteria = &MyCollection.ItemByName("PHONELIST");

Syntax

Next()

Description

The Next method returns the next QueryCriteria object in the QueryCriteria collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.

Parameters

None.

Returns

A reference to a QueryCriteria object if successful, NULL otherwise.

Example

&MyQueryCriteria = &MyCollection.Next();