FATS - Fast Access Tree System
Table of Contents
List of Commands
"MB" Build Matchcode

"MB" Build Matchcode


Command string:

CMND$ = "MB\{FileNo}\{RecID}\{Col1data}[\{Col2data}[\{Col3data}]]"

FileNoFile number
RecID!= 0 Record- resp. id-number
== 0 Stop Build, no more records
Col#data Content of data column #
[ ]Optional

Purpose:

Build the Matchcode-Index.

Description:

This command complements the matchcode index around the content of the columns or fields of a data record and assigns the record- resp. ID-number specified via "RecID" to this record. Use this command to place the content of all data records into the matchcode index after a successful  Create Matchcode File (MC) - command within a programme loop. The command only can be used during a complete creation of the matchcode index, i.e. immediately according to a call of the "MC"-command. Later modifications of the matchcode index are implemented via the  Insert Matchcode (MI) - command.

The position of the data columns within the command string ("Col#data") corresponds to that with the call of command Create Matchcode File (MC) determined definition. The separator used in the command string (standard: backslash) should not occur in the transferred text since as a result the order of the data columns would be changed.

While indexing sequential data resources, the number specified via "RecID" should correspond to the physical record number i.e. the first data record has number 1, the second record number 2.., in the case of data records marked as deleted, the content of the data columns is not specified ("MB\{FileNo}\{RecID}").
The Build Matchcode (MB) command demands an ascending number as a "RecID" argument i.e. the matchcode can not usually be indexed in the logical order of an index-key.

The record- resp. ID-number ("RecID") is provided to the application program later via the variable RECNO.

The command "MB\{FileNo}\0" terminates indexing and closes the corresponding matchcode file. The file is closed automatically in the case of a premature abnormal termination of indexing. A subsequent close-command can always remain undone.

This command is only supported by the extended version of FATS.

Parameters returned:

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

Example:

CMND$ = "MB\1\"+STR$(RECNO)+"\"+COL1$+"\"+COL2$

 BASIC Example
 Pascal Example
 C Example

See also:

 "MI" Insert Matchcode; page 4-67
 "MC" Create Matchcode File; page 4-55


 

© 2008  GCS Software, Udo Gertz