Request_Find - BaseData_Set

Finds on specified table using given find mode and index

Type: Procedure

Parameters: Integer eFindMode Integer iFile integer iIndex

ParameterDescription
eFindModeMay be any of the standard find modes, i.e., lt, le, eq, ge, or gt, or it may be either Next_Record, First_Record, or Last_Record
iFileNumber of the table to perform find operation on
iIndexNumber of table index to use for find operation


Syntax
Procedure Request_Find Integer eFindMode Integer iFile integer iIndex

Call: Send Request_Find eFindMode iFile iIndex


Description

The Request_Find procedure finds on specified table using given find mode and index. If find is successful, performs a relate on the table. If the passed in table is the same as this object's Main_File, sends Relate_Main_File. Notifies other connected DataDictionary objects (DDOs) of the result of the find. Sets the Found indicator to reflect the success or failure of the find operation. Sent by DEOs and Item_Find.

If you send this message to a DDO from the program (rather than from a DEO), precede this with Entry_Update 0 1 to make sure the table buffer contains the record you intend to act on.

Sample

This sample will find a record in Data Dictionary Object (DDO) oCustomer_DD with Customer.Id equal to 12, providing that index 1 is a unique index for Customer.Id.

Send Clear of oCustomer_DD
Move 12 to Customer.Id
Send Request_Find of oCustomer_DD EQ Customer.File_Number 1


Sample

This sample will find the first record in Data Dictionary Object (DDO) oCustomer_DD using index 1.

Send Clear of oCustomer_DD
Send Request_Find of oCustomer_DD GE Customer.File_Number 1


Sample

This sample will also find the first record in Data Dictionary Object (DDO) oCustomer_DD using index 1. This code is more readable than that in the sample above since it uses the First_Record constant.

Send Request_Find of oCustomer_DD First_Record Customer.File_Number 1


Next_Record

Find mode Next_Record will use the same find direction and index as the prior Find operation (in other words, the index passed with Next_Record is ignored). Using find mode Next_Record must be preceded by a find using one of the other modes, or it will result in an error.

Sample

Procedure FindAll Boolean bFindDown
    Boolean bFound

    If bFindDown begin
        Send Request_Find of Vendor_DD First_Record Vendor.File_Number 1
    End
    Else Begin
        Send Request_Find of Vendor_DD Last_Record Vendor.File_Number 1
    End
    Move (Found) to bFound
    While bFound
         Send ProcessThis Record  // not a predefined message
         Send Request_Find of Vendor_DD Next_Record Vendor.File_Number 1
         Move (Found) to bFound
    Loop
End_Procedure  // FindAll


Data Dictionary SQL Filters

Data Dictionary SQL Filters can be used with this method. See pbUseDDSQLFilters for more information.

Notes

Request_Find is not re-entrant. Once a major Data-Dictionary operation (save, find, delete, clear) has begun you cannot start another major operation. The reentrancy restriction applies within DDO structures and across DDO structures.

See Also

Finding - Find, Request_Find and FindByRowId | Find and Clear Operations in DDOs