QueryField Collection Methods

In this section, we discuss each QueryField method. The methods are discussed in alphabetical order.

Syntax

First()

Description

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

Parameters

None.

Returns

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

Example

&MyQueryField = &MyCollection.First();

Syntax

Item(number)

Description

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

Parameters

Field or Control

Definition

Number

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

Returns

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

Example

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

Syntax

ItemByNameAndAlias(Name, RecordAlias)

Description

The ItemByNameAndAlias method returns the QueryField object with the given Name and Record Alias.

Parameters

Field or Control

Definition

Name

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

RecordAlias

Alias of the record to which the field belongs

Returns

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

Example

&MyQueryField = &MyCollection.ItemByNameAndAlias("PHONELIST", "A");

Syntax

ItemByExpNum(ExpNum)

Description

The ItemByExpNum method returns the QueryField object with the given Expression Number, ExpNum.

Parameters

Field or Control

Definition

ExpNum

Expression Number for the given expression field. Non-expression fields have 0 value for the Expression Number.

Returns

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

Example

&QryFld = &QryFldCol.ItemByExpNum(1);

Syntax

Next()

Description

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

Example

&MyQueryField = &MyCollection.Next();