Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- db_VISTA III - d_keyprev http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   D_KEYPREV

SUMMARY
   d_keyprev(FIELD[,dbn])
   long FIELD;
   int dbn;

ARGUMENTS
   FIELD       The field type of the key field for which the previos key
               will be found.

   dbn         (optional) The number of the database containing the record.

DESCRIPTION
   Function d_keylast finds a record occurence associated with the previos
   occurrence of the key FIELD.Status S_NOTFOUND is returned if there
   are no more keys.db_VISTA keeps track of the relative position of each
   key field so that d_keyprev can be performed for multiple keys at time.
   Also note so that d_keyprev ( or the first one after status
   S_NOTFOUND was returned)will return the first key on file.

CURRENCY CHANGES
   curr_rec=record with previos key;

RETURN CODES

   0    S_OKAY          Previos key was found.

   2    S_NOTFOUND      There are no keys on file for specified key field.

  -5    S_INVFLD        Invalid field type.You either did not pass a
                        field type or yuo passed field type which is
                        not in the current record.

  -17   S_NOTKEY        FIELD is not defined as a key.

  -24   S_NOTLOCKED     Key file containing FIELD is not locked.


EXAMPLE
    /*display all info records in irevese d_code order*/
    while(d_keyprev(ID_CODE) == S_OKAY){
       d_recread(&irec);
       .. /*print info record contens*/
    }

See Also: d_keyfind d_keyfrst d_keylast d_keylast

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson