get_first



Summary

#include <dataman/dataman.h>

get_first(idx_name) else ...

char *idx_name;

Description

int db_g_frst

This function retrieves the lowest order key and its associated record from the named index. Where idx_name is the name of the index that the first key is to be retrieved from. If the index is empty, the else clause is executed. If the named index is not empty the current record in memory is flushed, the index KP is set to the first key, the MFRP is set to the associated record and that record is retrieved.

Example

    #include <dataman/dataman.h>

    main(argc,argv)
    {

        get_first(num_ix) else    /* get first account */
            fatal("Index %s is empty\n",num_ix);
        while (1) {
              ...                   /* process */
            get_next(num_ix) else   /* next account */
                break;              /* end loop */
        }
    }


    This will loop through an entire index.

«previous  next»