|
The Get Less Than or Equal operation (B_GET_LE) retrieves a record in which the value for the key specified by the Key Number has an equal or a previous lesser value than the value you supply in the Key Buffer. The MicroKernel first tries to satisfy the equal requirement. If the key allows duplicate values, this operation retrieves the last record (chronologically) of the group with the same key values. You can use the Get Key (+50) bias to detect the presence of a value in a file. A Get Key operation is generally faster.
Note
If you are using the Get Less Than or Equal operation on descending keys, the next lesser value refers to a value higher than the one specified in the Key Buffer.
If the Get Less Than or Equal operation is successful, the MicroKernel returns the record in the Data Buffer, the key value for the record in the Key Buffer, and the length of the record in the Data Buffer Length parameter.
If the Get Less Than or Equal operation is unsuccessful, the MicroKernel returns one of the following status codes:
|
3
|
The file is not open. |
|
6
|
The key number parameter is invalid. |
|
22
|
The data buffer parameter is too short. |
The Get Less Than or Equal operation establishes the complete logical and physical currencies and makes the retrieved record the current one.
|
Chapter contents
Prev topic: Get Less Than (10)
|