Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- db_VISTA III - d_renfile http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   D_RENFILE

SUMMARY
   d_renfile(dbname,FILEID,filenm)
   char *db
   char *value;
   int dbn;

ARGUMENTS
   value       A pointer to the data to be copied into the the current
               record.

   dbn         (optional)The number of the database containing the record

DESCRIPTION
   This function copies the data from the location pointed to by value
   into the current record.Key fields will be automatically updated.
   Sorted sets with sort fields contained in the currend record will be
   automatically updated.However,where multiple fields in the record is used
   as sort fields in the same set,better performance will result if you
   disconect the current record from all orted sets before calling d_recwrite
   and then reconnect it following the call.

CURRENCY CHANGES
   None

RETURN CODES
    3    S_DUBLICATE   Dublicate key.

    -7   S_NORC        The current record is null.

    -24  S_NOTLOCKED   Record type of current record is not locked.

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

EXAMPLE
    /* Modify info record*/
    mod_info(id);
    char id;
    {
      if(d_keyfind(ID_CODE,id) == S_OKAY){
              d_recread(&irec);
              /*user edits info data*/
              if(edit_info(&irec){
                             /* okay to update*/
                             d_recwrite(&irec);
              }
              else
                 ... /*edit canceled*/
      }
      else if(db_status==S_NOTFOUND)
                 usermsg("id code not found");
   }

See Also: d_csmwrite d_csowrite d_crwrite

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson