FATS - Fast Access Tree System
Table of Contents
List of Commands
"S" Search

"S" Search


Command string:

CMND$ = "S\{KeyNo}\{FileNo}\{KeyString}"

KeyNoKey number
FileNo File number
KeyString Key value

Purpose:

Gets the record number of the data record whose key value matches the requested key value.

Description:

With this command, your application can retrieve the number of a record based on a specific key value. If there are duplicates, the first duplicate of the specified key value is returned.

If FATS finds the requested key, it returns the key value in the FATSKEY variable and a errorcode of 0. Otherwise, it returns a nonzero status in the ERRORCODE variable indicating why it cannot find the key:

12There is no key which equals the value specified over "KeyString", FATS returns the record number of the adjacent smaller key
13The specified key was not found because it is smaller than all keys in the index file. FATS returns the first key in the file.
15The specified key was not found because it is greater than all keys in the index file. FATS returns the last key in the file.
16There wasn’t inserted any key into the index file.

Parameters returned:

ERRORCODE:Errorcode or 0 (no error)
RECNO:Record number
FATSKEY:Key value (or KEYADR=address of key)

Example:

CMND$ = "S\1\1\"+KEYSTRING$

See also:

 "G" Search Generic; page 4-34
 "A" Search Next After; page 4-10
 "E" Search Previous Before; page 4-28
 "F" Search First; page 4-32
 "L" Search Last; page 4-46


 

© 2008  GCS Software, Udo Gertz