[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_IDXFUNC Index expression function type
------------------------------------------------------------------------------
Declaration
database.hdr
Syntax
proc _IDXFUNC ptr
Arguments
None.
Return
None.
Description
The _IDXFUNC function type is used to declare a pointer to a
procedure that serves as the index expression during dynamic indexing
operation. The function type is used in conjunction with the
dynindexinit() function to install an index expression function.
Example
#define EXAMPLE_TYPE
#define _DYNALIAS_
#define _ALIASPTR_
#include example.hdr
#define LEN_INDEXFIELD 15
vardef static
_PALIAS pDbf // dynamic alias pointer
_FLDBAG sData
enddef
proc IdxFunc static // index expression function
sData.pSet := 0
dynrep( pDbf, 2, sData )
endproc
proc Test_IDXFUNC
vardef
char cFirst, cLast
enddef
pDbf := dynopen( 0, "stest.dbf", DO_SHARED ) // open database
dynindexinit( "test.fdx", &IdxFunc, sData.cChar, LEN_INDEXFIELD, FT_CHAR )
index __dynindex // create index
seek "Vanderbilt" // seek for a name
if found()
sData.pSet := 0
dynrep( pDbf, 1, sData )
cFirst := sData.cChar
sData.pSet := 0
dynrep( pDbf, 2, sData )
cLast := sData.cChar
? "Record found", istr( recno() ), trim( cFirst ), cLast
endif
endproc
proc main
Test_IDXFUNC()
endproc
See Also: dynindexinit()
Online resources provided by: http://www.ClipX.Net --- NG 2 HTML conversion by Dave Pearson