D_RECFRST(1)

NAME
d_recfrst - find the first record in a table

SYNOPSIS
#include <typhoon.h>
d_recfrst(ulong recid)

DESCRIPTION
d_recfrst finds the first record in the table specified by recid. If d_recfrst returns S_NOTFOUND the table is empty.

DIAGNOSTICS
The status code returned by the function is also stored in the global variable db_status.

S_OKAY
    A record was found.

S_NOTFOUND
    The key value was not found, i.e. the index is empty.

S_NOCD
    There is no current database.

S_INVREC
    The id is not a record id.

CURRENCY CHANGES
If S_OKAY is returned, the record found becomes the current record.

EXAMPLE
/* Traverse the customers in randomorder */ #include <typhoon.h>
d_recfrst(CUSTOMER);
while( db_status == S_OKAY )
{
    struct customer cust;
    d_recread(&cust);
    printf("%s\n", cust.name);
    d_recnext(CUSTOMER);
}

IDENTIFICATION
Author: Thomas B. Pedersen.
Copyright (c) 1994 Thomas B. Pedersen.

SEE ALSO
d_reclast(1), d_recnext(1), d_recprev(1), d_recread(1).