package dbase4
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Dbase4.Base
Source
type dbf_file = {
name : string;
(*name of dBASE table or filename
*)fin : in_channel;
(*opened database file channel
*)memo : in_channel option;
(*opened database memo file channel
*)info : dbf_info;
(*description of table structure
*)cri : int;
(*current record index
*)
}
Database file descriptor
and dbf_info = {
version : dbfile_format;
(*version/format of the database
*)mdate : date;
(*modification date
*)num_records : int;
(*number of records (include deleted)
*)hdr_size : int;
(*header size (in bytes) of the database file
*)rec_size : int;
(*the record size in bytes
*)fields : dbf_field_descriptor array;
(*array of the field descriptors
*)
}
Type dbf_info
describes the DBF file structure
Type date
describes date in format (year , month , day)
and dbf_field_descriptor = {
name : string;
(*name of field
*)ftype : dbf_data_type;
(*data type of field
*)faddr : int;
(*offset of the field in a memory chunk
*)flen : int;
(*length of the field in bytes
*)fdec : int;
(*position of decimal point
*)work_area_id : int;
(*work ared identity - IT IS NOT USED
*)flags : int;
(*internally used flags
*)
}
Database filed descriptor
and dbf_data_type =
| Character
(*one char or ASCII-string up to 255 character
*)| Number
(*represents any number: integer or real
*)| Float
(*represents floating-point number
*)| Date
(*represents DATE in format YYYYMMDD
*)| Logical
(*logical (boolean) value
*)| Memo
(*reference to the MEMO file record/chunk
*)| General of int
(*general purpose
*)
val db_find_record_simple :
dbf_file ->
(Bitstring.bitstring option -> 'a) ->
'a ->
int option