AddKey Add key value to index file. Short Name ADDKEY() Type Low level index file function Declaration COUNT AddKey(COUNT keyno, pVOID target, LONG recbyt, COUNT typadd) Description AddKey() inserts the key value pointed to by target and the associated data record position recbyt into index file number keyno. typadd determines how a full B-Tree node is split. The symbolic constants defined in ctport.h, REGADD, INCADD, and DECADD, represent the three node splitting options:
Return
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example TEXT target[11]; LONG recbyt; COUNT name_key;
printf("\nAddKey error = %d",uerr_cod);
Limitations AddKey() does not pad key values. If passed a key value which is not completely specified to its full length, AddKey() uses whatever “garbage” follows the key value in memory up to the key length. Key values added to an index allowing duplicate keys, (keydup = 1 in CreateIndexFile() or CreateIndexMember()), have their last 4 bytes overwritten by the associated data record position. In this way, identical key values become distinguishable. The recbyt parameter in this function is a 4-byte value capable of addressing at most 4 gigabytes. If your application supports HUGE files (greater than 4 gigabytes), you must use the ctSetHgh() and ctGetHgh() functions to set or get the high order 4 bytes of the file offset. See also CreateIndexFile() and CreateIndexMember() specify the key value characteristics of length, type, and allowance for duplicate values at index file creation. |
||||||||||||||||||||||||||||||