There is in Gifa a support for the UNIX standard data-base file format dbm. A dbm data-base is composed of two file : base_name.pag and base_name.dir which together hold the information of the base_name data-base. Each entry consist of a field indexed with an access key. Each entry is accessed with the access key. Data can be retrieve, stored, modified in the data-base. Every operations are realised on the file, but the disk accesses are minimised.
In Gifa, such a dbm data-base is accesses through a binding to an associative array. Each entry of the data-base appear as a element of the array. Reading, storing and modifying entries is performed by fetching and assigning array values. The access key of the entry in the dbm file appears as the index of the associative array, and the content appears as the value of the associative array. Due to internal Gifa limitation, only key up to 31 characters and entry up to 256 characters can be handled.
These two commands permits to associate the dbm file with a pseudo internal array variable. The command
dbopen array_name file_name
will associate a pseudo associative array with the dbm files of base name : file_name. The file is created if it does not exist yet. No actual variable array_name is created, but each operation on it is performed on the dbm file.
DBCLOSE closes the file and forget about the array array_name .
The functions dbm() and nextlm() permits to handle the dbm file in macro processing. The control FOREACH permits to scan easily through all the entries of a dbm file.