E@DBFINDMIDRNG
Name
The E@DBFINDMIDRNG call has the following format:
DN@<Logical>(E@DBFINDMIDRNG)
where <Logical> identifies the database file and index to use to perform the E@DBFINDMIDRNG call.
Description
When you need to process a range of data, starting at a given point in the range, use E@DBFINDMIDRNG.
Using the API in a Program
You can use this routine by itself or in conjunction with E@DBFINDBEGRNG and E@DBFINDNXTRNG.
The database routines perform an equal condition on all D@ fields that have an assigned value—that is, all columns up to, and including, the field moved to E@DBBEGRNG.
Input Values
Field | Description |
---|---|
<Logical> | <Logical> in the E@ statement identifies the database file and index to use to perform the call. |
Record retrieval variables (also known as D@ fields) | Define the beginning and ending values of the last key by moving the appropriate values to the record retrieval fields named D@<KeyFieldName>. |
E@DBBEGRNG | Move a number into E@DBBEGRNG in order to tell the interface which key is the last significant one defining the range. This number is equivalent to the position of the field in the index. |
Return Values
Field | Description |
---|---|
D<prefix>@NOTFOUND |
Each routine sets the logical value <FileName>-NOTFOUND or <FileName>-FOUND based on the outcome of the read process. The Find routines set D<prefix>@NOTFOUND to FALSE if a record is found, TRUE if a record is not found, or E@KEY@FOUND if the keys are found. |
Programming Examples
This example uses the 850-FIND-BEGRNG-NAMSET1 routine to locate records with the last name of Smith, then uses the 850-FIND-MIDRNG-NAMSET1 routine to find records with the last name of Smith and first name of Pam.
|
The next example uses the E@DBFINDMIDRNG routine by itself to go directly to record with E@DBBEGRNG, and process from that record forward.
|
This final example sets the initial range value on D@ALTTYP field using the E@DBFINDBEGRNG routine, and then sets the mid-range values from the initial E@DBFINDBEGRNG results. Processing with the E@DBFINDMIDRNG routine starts at the next INVOICE value.
|