FATS - Fast Access Tree System
Table of Contents
List of Commands
"P" Search Previous

"P" Search Previous


Command string:

CMND$ = "P\{FileNo}"

FileNo File number

Purpose:

Gets the key value and record number of the data record preceding the current record.

Description:

With this command your application can retrieve the record number corresponding to the first key value which is less than the key value recently returned by one of the browser commands ("A", "E", "F", "G"...), which have to be executed as the latest command.
If a duplicate key exists, the next lower record number of the previous duplicate will be returned.

Each modification of the index file by inserting or deletion of keys makes an internal pointer invalid that is necessary for this instruction. You better use the command  Search Previous Before (E) because this can happen in the network environment from any station.

If there is no previous key in sequence FATS will return an errorcode of 13.

Parameters returned:

ERRORCODE:Errorcode or 0 (no error)
RECNO:Record number
FATSKEY:Key value (or KEYADR=address of key)

Example:

CMND$ = "P\1"

See also:

 "E" Search Previous Before; page 4-28
 "PD" Search Previous Different; page 4-77
 "ED" Search Previous Different Before; page 4-30


 

© 2008  GCS Software, Udo Gertz