QueryDBRecordField Collection Methods
In this section, we discuss the QueryDBRecordField collection methods. The methods are discussed in alphabetical order.
Syntax
First()
Description
The First method returns the first QueryDBRecordField object in the QueryDBRecordField collection.
Parameters
None.
Returns
A reference to a QueryDBRecordField object if successful, NULL otherwise.
Example
&MyQueryDBRecordField = &MyCollection.First();
Syntax
Item(number)
Description
The Item method returns the QueryDBRecordField object that exists at the number position in the QueryDBRecordField collection.
Parameters
Field or Control |
Definition |
---|---|
Number |
Specify the position number in the collection of the QueryDBRecordField object that you want returned. |
Returns
A reference to a QueryDBRecordField object if successful, NULL otherwise.
Example
For &I = 1 to &Coll.Count;
&MyQueryDBRecordField = &Coll.Item(&I);
/* do processing */
End-For;
Syntax
ItemByName(Name)
Description
The ItemByName method returns the QueryDBRecordField object with the name Name.
Parameters
Field or Control |
Definition |
---|---|
Name |
Specify the name of an existing QueryDBRecordField within the QueryDBRecordField collection. If you specify an invalid name, the object is NULL. |
Returns
A reference to a QueryDBRecordField object if successful, NULL otherwise.
Example
&MyQueryDBRecordField = &MyCollection.ItemByName("PHONELIST");
Syntax
Next()
Description
The Next method returns the next QueryDBRecordField object in the QueryDBRecordField 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 QueryDBRecordField object if successful, NULL otherwise.
Example
&MyQueryDBRecordField = &MyCollection.Next();
Syntax
Sort(SortCriteria)
Description
Use the Sort method to sort the fields within the QueryDBRecordField collection, based on the sort criteria specified with the method.
Parameters
Field or Control |
Definition |
---|---|
SortCriteria |
Specify the sort order for the list. This parameter can take either a constant or numeric value. See below. |
The values for OutputFormat can be as follows:
Numeric Value |
Constant Value |
Description |
---|---|---|
1 |
%Query_SortNameAsc |
Sort database fields in ascending order based on field name. |
2 |
%Query_SortNameDesc |
Sort database fields in descending order based on field name. |
3 |
%Query_SoftFldNumAsc |
Sort database fields in ascending order based on field number. |
4 |
%Query_SortFldNumDesc |
Sort database fields in descending order based on field number. |
Returns
0