release



Summary

#include <dataman/sort.h>

release else ...

Description

int db_rel(void)

The release function releases the current work file record and moves to the next sequential record in the work file. Routines in which there are more than one work file (sort programs), if the current record is the last in a file, that record is flushed, that file closed, the next work file opened, the first record of the new file read into memory, and the global 'new file' indicator is set to true. When the first release is performed after the new file indicator has been set to true, the indicator is then set to false. If at the end of the last work file, the record is not flushed, the else clause taken, and the new file indicator is not set to true.

Example

    #include <dataman/sort.h>

    main(int argc, char *argv[])
    {

        mkidx(argc,argv);    /* init sort program */
          ...
        while(1) {
              ...
            sort(key);       /* insert key in index */
            release else     /* move to next record */
                break;       /* end of processing */
            when_file        /* new file now? */
                show(10,10,"Working on file",10,26,FILE,ENDLIST);
              ...
        }
    }

«previous  next»