1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
function not_exist(var Fich : File) : boolean;
begin
{$I-}
Reset(fich);
{$I+}
if IOResult = 0 then
begin
not_exist := False;
close(Fich);
end
else not_exist := True;
end;
procedure TForm_general.FormCreate(Sender: TObject);
Var NomFichier : file ;
begin
Assignfile(NomFichier, 'Categ.Dbf');
If not_exist(NomFichier) then
begin
Dbf_Cat.TableLevel := 4;
Dbf_Cat.TableName := 'Categ.dbf';
With Dbf_Cat.FieldDefs do
begin
Add('CAT', ftString, 2, True);
Add('LIBELLE', ftString, 35, True);
Add('COT_OBLIG', ftboolean,0,true);
Add('POSSIB_APP', ftboolean,0,true);
Add('COTISATION', ftfloat,0,true);
End;
Dbf_Cat.CreateTable;
end;
end; |
Partager