QueryDBRecord Collection Methods

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

Syntax

First()

Description

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

Parameters

None.

Returns

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

Example

&MyQueryDBRecord = &MyCollection.First();

Syntax

Item(number)

Description

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

Parameters

Field or Control

Definition

Number

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

Returns

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

Example

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

Syntax

ItemByName(Name)

Description

The ItemByName method returns the QueryDBRecord object with the name Name.

Parameters

Field or Control

Definition

Name

Specify the name of an existing QueryDBRecord within the QueryDBRecord collection. If you specify an invalid name, the object is NULL.

Returns

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

Example

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

Syntax

Next()

Description

The Next method returns the next QueryDBRecord object in the QueryDBRecord 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 QueryDBRecord object if successful, NULL otherwise.

Example

&MyQueryDBRecord = &MyCollection.Next();