D_CRREAD(1)

NAME
d_crread - read a field from the current record

SYNOPSIS
#include <typhoon.h>
d_crread(ulong fieldid, void *buf)

DESCRIPTION
d_crread copies the contents of the field specified by fieldid into the buffer buf. If the field is a variable length field, only the actual number of bytes in the field is copied.

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

S_OKAY
    Operation successful.

S_NOCD
    There is no current database.

S_NOCR
    There is no current record.

S_INVFLD
    The id is not a valid field.

CURRENCY CHANGES
None.

EXAMPLE
/* Get Pedersen's account number */
#include <typhoon.h>
if( d_keyfind(CUSTOMER_NAME, "Pedersen") == S_OKAY )
{
    unsigned long account;
    d_crread(CUSTOMER_ACCOUNT, &account);
    printf("Account number %lu\n", account);
}

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

SEE ALSO
d_recread(1), d_keyread(1)