D_CSMWRITE

SUMMARY
d_csmwrite(SET,FIELD,value[,dbn])
int SET;
long FIELD;
char *value;
int dbn;

ARGUMENTS
SET Set type of current member to be written.
FIELD The field type from current member.
value Pointer to new value.
dbn (optional)The number of the database containing the record

DESCRIPTION
Function d_csmwrite writes the data pointed to by value to data field
FIELD in the current member of SET. If FIELD is a key field, the key will
automatically be updated. If FIELD is used as a sort field for an
ascending or descending ordered set, the record's position in the set
will autimatically be adjusted accordingly. If FIELD is an array field,
the entire array is written. Elements of an array cannot be written
individually. Fields used in a compound key cannot be modified with this
function -use d_recwrite instead.

CURRENCY CHANGES
None

RETURN CODES
-2 S_INVSET Invalid set type. Probably passed a record or field
type instead of set.

-5 S_INVFLD Invalid field type. You either did not pass a field
type or you passed a field type which is not in the
current member.

3 S_DUPLICATE Duplicate key

-9 S_NOCM The current member is null.

-15 S_ISCOMKEY Illegal operation using compound key field.

-24 S_NOTLOCKED Record type containing FIELD is not locked.

-27 S_TRNOTACT Transaction not active. In shared mode,changes can
only be made from within a transaction.

-39 S_COMKEY Records containing compound keys cannot be updated.

EXAMPLE
char name[32]; /* author name */
..
/* Change author "Worth" with "Wirth" */
for (d_findfm(AUTHOR_LIST); db_status==S_OKAY; d_findnm(AUTHOR_LIST))
{
d_csmread (AUTHOR_LIST,NAME,name);
if (strcmp(name,"Worth")==0)
d_csmwrite(AUTHOR_LIST,NAME,"Wirth");
}
..