home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- FUNCTION NDXKEY (ndx_name, clip_ndx)
- *****************************************************************
-
- * Reads key expression of an index file
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- LOCAL handle := key_start := 0, ret_string := ''
-
- * Default to Clipper NTX extensions if not passed
- clip_ndx = IF(VALTYPE(clip_ndx) != 'L', .T., clip_ndx)
- key_start = IF(clip_ndx, 22, 24)
-
- * Open index file in read only mode
- handle = FOPEN(ndx_name,0)
- IF FERROR() = 0
-
- * Move file pointer to beginning of key expression
- FSEEK(handle, key_start, 0)
-
- * Read index key to first null byte or maximum length of 256
- ret_string = FREADSTR(handle, 256)
-
- ENDIF
-
- * Close file and return index expression
- FCLOSE(handle)
- RETURN(ret_string)
-
-