F.92 DeleteKeyBlind
Delete key value when associated data record position is not known.
Short Name
DELBLD
TYPE
Low level index file function
DECLARATION
LONG DeleteKeyBlind(COUNT keyno, pVOID target)DESCRIPTION
DeleteKeyBlind deletes the key value pointed to by target from index file keyno, if such a key value exists. DeleteKeyBlind cannot be used when the index file supports duplicate keys.
RETURN
If the key value is found in the index, it is deleted and DeleteKeyBlind returns the associated data record position. If it is not found, or some error is detected, DeleteKeyBlind returns a zero (which is never a legal data record position), and uerr_cod is set as follows:
Value Symbolic Constant Explanation 0 NO_ERROR Successful deletion. 4 KDEL_ERR Cannot find key value to delete. 5 KBLD_ERR Cannot call DeleteKeyBlind when duplicate keys are supported.
See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.
EXAMPLE
LONG recbyt;COUNT keyno;TEXT target[24];keyno = 1;printf("\nEnter key value: ");scanf("%23s",target);if (recbyt = DeleteKeyBlind(keyno,target))printf("\n%s deleted (data record position = %ld).", target,recbyt);elseprintf("\nUnsuccessful deletion (code = %d).",uerr_cod);LIMITATIONS
Cannot be used with an index supporting duplicate key values. Without knowledge of the associated data record position, there is no way to distinguish among identical key values.
SEE ALSO
DeleteKey.
|
FairCom Corporation www.faircom.com |