xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HS_Open()

Opens a HiPer-SEEK index file.

Syntax

HS_Open( <cFileName>  , ;
         <nBufferSize>, ;
         <nOpenMode>    ) --> nHsxHandle

Arguments

<cFileName>
This is a character string holding the name of the HiPer-SEEK index file to open. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory. If no file extension is given, the extension .HSX is used.
<nBufferSize>
This is a numeric value specifying the memory buffer size in kB to be used by other HS_*() functions for this file (the value 10 means 10240 bytes).
<nOpenMode>
This numeric parameter specifies how the HiPer-SEEK index file is opened. Possible values for <nOpenMode> are:

Open modes for HiPer-SEEK index files
ValueDescription
0READ-WRITE + SHARED
1READ-WRITE + EXCLUSIVE
2READ-ONLY + SHARED
3READ-ONLY + EXCLUSIVE4

Return

The function returns a numeric value greater or equal to zero when the HiPer-SEEK index file can be opened. This value is a handle to the HiPer-SEEK index file and must be used with other HS_*() functions.

A negative return value indicates an error condition:

Error codes of HS_Open()
ValueDescription
-2Not enough memory or <nBufferSize> is too large.
-5Read error while reading.
-10File cannot be opened.
-16Invalid parameters are passed.
-17No more file handles available.
-20File cannot be locked.
-21Lock table exhausted.
-22File cannot be unlocked.

Description

HS_Open() opens an existing HiPer-SEEK index file and returns a file handle to it. This handle must be preserved and passed to HS_Add() when new index entries should be added, or to HS_Set() and HS_Next() to perform a search.

Info

See also:HS_Add(), HS_Close(), HS_Create(), HS_Next(), HS_Set()
Category: Database functions , HiPer-SEEK functions , Index functions , xHarbour extensions
Source:rdd\hsx\hsx.c
LIB:lib\xhb.lib
DLL:dll\xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe