[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
USAGE
signed int scdiktop(
signed int handle,
void *key,
signed long *recno );
PROTOTYPE IN
sc_base.h
DESCRIPTION
scdiktop will set the current key pointer to the first logical key in
the index and return the key value key and data record number recno
associated with the new current key.
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.
Numeric keys are returned as doubles, and character keys are returned as
strings.
EXAMPLE
/* Character Key Example */
#include <stdio.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) {
name[64] = 0;
scdiktop(idx,name,&recno);
printf("%s %ld\n",name,recno);
scdiclose(idx);
}
scdterm();
}
/* Numeric Key Example */
#include <stdio.h>
#include <softc.h>
#include <sc_base.h>
void main()
{
int idx;
double length;
long recno;
scdinit(20,0);
if (scdiopenx(&idx,"TOCLNGTH.IDX",SC_BUFFER) == SC_SUCCESS) {
scdiktop(idx,&length,&recno);
printf("%lf %ld\n",length,recno);
scdiclose(idx);
}
scdterm();
}
See Also:
scdiinfo
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson