function CreateAndOpenDatabase(filename :string; cnt, mt :integer): integer;

CreateAndOpenDatabase creates a new dbf file according added fields and opens the created file. It returns non-zero value if success.
The accepts parameters: a name of a new file, a number of fields, a type of a memo fields. It releases the allocated memory.

var dbf :integer; begin if NewDatabase then begin AddField('Name', 'C', 20); AddField('Birth', 'D', 0); AddField('Sex', 'L', 0); AddField('Salary', 'N', 10 + 2*256); AddField('Notes', 'M', 0); end; dbf := CreateAndOpenDatabase('clients.dbf', 5, 0); if dbf <> 0 then CloseBase( dbf ); end.