FATS - Fast Access Tree System
Table of Contents
List of Commands
"C" Create Indexfile

"C" Create Indexfile


Command string:

CMND$ = "C\{Filename}\{KeyLength}\{KeyCount}\{KeyType}\{FileNo}"

FileNamefilename, perhaps with an additional path
(e.g. C:/DATEN/ARTICLES.KEY or ARTICLES.KEY)
KeyLengthMaximum key length (1-240)
If you choose to have more than one key for this index file, you may specify the length for each key (separated by a semicolon ";") to conserve diskette space. Otherwise, the maximum length applies to all keys, i.e. every key will occupy the maximum space.
KeyCountNumber of primary keys (1-200)
KeyTypeKey type (A = Ascii text, I = Integer)
FileNo File number (1-40)

Purpose:

Creates a index file with the specified characteristics.

Description:

With this command you create an index file, whereby a possibly already existing file with the same name is deleted.
After the file is created it will be opened with the opening flags defined with the command  Auto Refresh (Y) and can be accessed under the file number you specified. There is no connection between the file handles assigned by the operating system and this file number.

Max. 200 primary keys per data record can be administered in an index file, the max. key length amounts to 240 characters.

Full path names must be specified using forward slashes (/) instead of Backslashes (\), because FATS normally uses the Backslash character as delimiter.
You may change the delimiters by placing the desired character as the first character of the command string, e.g.. CMND$ = "&C&C:\ARTICLES.KEY&1&1&A&1". Any character with an Ascii code less then 48 will be accepted.

Parameters returned:

ERRORCODE:Errorcode or 0 (no error)
RECNO:Undefined
FATSKEY:Undefined

Example:

In the following example, an application creates a index file with 3 alphanumeric keys. All of the keys have a fixed length of 30 bytes:

CMND$ = "C\ARTIKEL.KEY\30\3\A\1"

The next example illustrates the command string required to create a key file with 2 keys of different length. Key 1 has a length of 10 characters and the second key has a length of 30 characters:

CMND$ = "C\ARTIKEL.KEY\10;30\2\A\1"

After successful creating of the file you can access it under the file number 1.

 BASIC Example
 Pascal Example
 C Example

See also:

 "O" Open Indexfile; page 4-77
 "K" Close Indexfile; page 4-42
 "Y" Auto Refresh; page 4-77


 

© 2008  GCS Software, Udo Gertz