I need to know Lenght from a Numeric Field in DBASE format

On Fri, 09 Mar 2001 16:02:52 -0600, antonio <antonio_...@yahoo.com>
wrote:

Quote
>Now i need to create a table in DBase format , with a numeric Field in the
>same case
>you have the Length an the Dec pos , if i try with FieldDefs in TTable class
>you can't define Decimal Positions.

>How can i create a Table with numeric fields and define the Lenght and
>Decimal Pos with Delphi?

Here is an example for creating a dBase file with 2 N(7.0) fields:

  with Table1 do
  begin
    TableName := 'Test.DBF';
    TableType := ttDBase;
    TableLevel := 4;
  end;
  with Table1.FieldDefs do
  begin
    Clear;
    Add('CharField1',ftString, 15, False);
    Add('NumField1', ftBCD, 0, False);
    Items[Count - 1].Precision := 7;
    Add('NumField2', ftBCD, 0, False);
    Items[Count - 1].Precision := 7;
    Add('DateField1', ftDate, 0, False);
    Add('LogField1', ftBoolean, 0, False);
    Add('MemoField1', ftMemo, 0, False);
  end;
  Table1.CreateTable;

HTH,

Jan