back



Summary

#include <dataman/dataman.h>

back(index_name) else ...

char *index_name;

Description

int db_bck(index_name)

This procedure flushes the current record to disk and retrieves the data record preceding it to memory. The string index_name is the name of the index that points to the file that the user wants to back up, or the manifest constant WFILE. The function back is not to be confused with the get_prior function. The index refers to its MFRP, then checks if there is a record preceding this in the data base file. If not, the current record is not flushed, and the else clause is executed. If there is a previous record, the current one is flushed, the MFRP is decremented, and the new current record is read into memory. If the index has no current record (i.e. a GET has not occurred) the diagnostic 'Initial GET not attempted' will display and the routine will terminate. If idx_name is the manifest constant WFILE the operation will affect the work file.

Example

    #include <dataman/dataman.h>

    main(argc,argv)
    int argc;
    char **argv;
    {
        key k_buff;
        ....
        get(idx1,k_buff) else {
            pause(10,10,"Can't find key");
            exit(0);
        }
        while (MFMT == 3) {
            back(idx1) else    /* keep backing */
                break;         /* first of file */
            ...                /* process record */
        }
    }

«previous  next»