[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
USAGE
signed int scdikfind(
signed int handle,
void *key,
signed long *recno,
signed int method );
PROTOTYPE IN
sc_base.h
DESCRIPTION
scdikfind supports two key search methods (determined by method):
SC_EXACT - find an exact match with key and recno, and
SC_FIRST - find the first logical occurrence of key in the index
and return the associated record number recno if found.
If a match cannot be found, the current key will be the physical key
which would immediately precede key. The current key's value and data
record number will be returned in key and recno.
NOTES
The user must ensure that the buffer used to return the key is large
enough to hold the entire key. The maximum length of the key can be
determined via a call to scdiinfo.
When searching using character keys it is necessary to pad the key string
to size with spaces (" "), the function will not automatically do this for
you. Because of the above restriction, searching for partial keys is not
currently supported.
Numeric keys are returned as doubles, and character keys are returned as
strings.
EXAMPLE
#include <stdio.h>
#include <string.h>
#include <softc.h>
#include <sc_base.h>
void main()
{
int idx;
char name[65];
long recno;
scdinit(20,0);
if (scdiopenx(&idx, "TOCNAME.IDX", SC_BUFFER) == SC_SUCCESS) {
strcpy(name,"ABCDE");
recno = 7L;
if (scdikfind(idx, name, &recno, SC_FIRST) != SC_SUCCESS)
puts(scemsg());
scdiclose(idx);
}
scdterm();
}
See Also:
scdiinfo
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson